Android ViewModel recreated when its Host Activity was not in the top of Activity Stack and the device was rotated
问题 I am in the following scenario: I have an OnboardActivity which contains a ViewModel , I can rotate this OnboardActivity many times and the ViewModel persist across configuration changes without issues. However, if I launch another Activity(FirebaseAuthActivity) on top of this one ( OnboardActivity ) with startActivityForResult(...) , and then in FirebaseAuthActivity I rotate the device and press the back button. When the OnboardActivity is brought to the top of the stack it recreates the