jakubkinst / Android-ViewModelBinding

A lightweight library aiming to speed up Android app development by leveraging the new Android Data Binding together with the Model-View-ViewModel design pattern.
294 stars 32 forks source link

Sample app crash on rotation #8

Closed mykola-dev closed 8 years ago

mykola-dev commented 8 years ago

Steps to reproduce:

  1. Run the app
  2. Rotate device
 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
                                                                                          at cz.kinst.jakub.viewmodelbinding.ViewModelBindingHelper.getViewModelIdFieldName(ViewModelBindingHelper.java:215)
                                                                                          at cz.kinst.jakub.viewmodelbinding.ViewModelBindingHelper.onCreate(ViewModelBindingHelper.java:72)
                                                                                          at cz.kinst.jakub.viewmodelbinding.ViewModelActivity.onCreate(ViewModelActivity.java:70)
jakubkinst commented 8 years ago

Sorry, that were unreleased changes being merged to master too early. Fixed on master.

mykola-dev commented 8 years ago

Bu i'm using latest code from master. Still crashes. Any advice?

jakubkinst commented 8 years ago

After you created the issue, I have reverted master to an earlier commit. Can you make sure your master is on this commit: https://github.com/jakubkinst/Android-ViewModelBinding/commit/e546d61b9ee7e3aeb548de0abbbb46c847f43a36 ? Thanks

mykola-dev commented 8 years ago

Yes, i made reset to this commit and now it works ok. Thanks