Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Version used: 1.0.0-alpha1
Devices/Android versions reproduced on: HTC One M9 (Android 6.0) but I think this info is irrelevant
Steps to reproduce:
1 activity (just root for fragments)
2 fragments - Fragment1 (with ViewModel1) and Fragment2 (with ViewModel2)
Working scenario:
1. Add Fragment1 with:
supportFragmentManager.beginTransaction().addToBackStack(null)
.replace(R.id.container, fragment).commit()
2. Go to Fragment2 with some button click in Fragment1 (replace Fragment1 with fragmentManager)
3. rotate the phone (ONCE)
4. click back button -> ALL WORKS (ViewModel1 survived)
Not working scenario:
- steps 1 and 2 are the same
3. rotate phone (TWICE or more)
4. click back button -> ViewModel1 is created again ?!!! and onCleared() from previously created ViewModel1 is not called - EditText has persisted its state but ViewModel hasn't ?!
Github with project: