This repository contains a detailed sample app that implements MVVM architecture using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
I have observed that in some classes like SplashActivity and LoginActivity ViewModel is directly been injected without using ViewModelProviderFactory.class.
But in MainActivity class ViewModel is not directly injected, it is instantiated using ViewModelProviderFactory.class I do not get the purpose these two approach.
I believe this is done due to the fact that Login and Splash screen do not support saving state of the view when screen is rotated, but MainActivity does. Is it true?
I have observed that in some classes like SplashActivity and LoginActivity ViewModel is directly been injected without using ViewModelProviderFactory.class. But in MainActivity class ViewModel is not directly injected, it is instantiated using ViewModelProviderFactory.class I do not get the purpose these two approach.
I believe this is done due to the fact that Login and Splash screen do not support saving state of the view when screen is rotated, but MainActivity does. Is it true?