You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HomeFragmentViewModel is retained after screen rotated and HomeActivity recreated.
But HomeFragmentViewModel still hold old HomeNavigator (alsoHomeActivity) instance.
The text was updated successfully, but these errors were encountered:
I've investigated this and what you described does not happen. Each fragment will get a new ViewModel created for it, which in turn gets the correct HomeNavigator.
Currently it is injected via Dagger at VM creation.
This does not work at all when the Activity is rotated,
since the VM still be holding onto the old Activity
instance.
This commits refactors this to be based around a ViewModel
and a LiveData for each action. The ViewModel holds those
LiveDatas and the current Activity observes them. Each
fragment then retrieves the NavigatorViewModel and invokes
the LiveData's (through the interface).
Closes#47
HomeFragmentViewModel
is retained after screen rotated andHomeActivity
recreated.But
HomeFragmentViewModel
still hold oldHomeNavigator
(alsoHomeActivity
) instance.The text was updated successfully, but these errors were encountered: