DEV Community

Discussion on: Don't think Viewmodel will replace SaveInstanceState

Collapse
 
funkymuse profile image
FunkyMuse

Viewmodel has save instance state already.

developer.android.com/reference/an...

Collapse
 
leviaran profile image
Randy Arba

Yes true, but this save/load state only trigger when activty/fragmenst still alive.

Collapse
 
funkymuse profile image
FunkyMuse • Edited

It's bound to the fragment so the view model gets new instance if not instantiated already when fragment is recreated