Cannot create an instance of custom ViewModel
Instead of:
mViewModel = ViewModelProviders.of(this).get(MoviesDataViewModel.class);
Perform:
mViewModel = ViewModelProviders.of(this, viewModelFactory).get(MoviesDataViewModel.class);
Need to add below code in all activity if you use multiple activity
AndroidInjection.inject(this);
The solution for me was injecting the activity because I was using Dagger2
AndroidInjection.inject(this);