This is a presentation given at DroidCon Americas 2020: https://www.online.droidcon.com/americas-speaker/sumayyah-ahmed
Abstract:
Contrary to our hopes, ViewModel lifecycles are not infallible. The Android OS can kill running processes, which means killing your ViewModel and all the state that you’ve saved in it, spelling impending disaster for your Activity or Fragment. Luckily, we have a new tool to maintain a seamless user experience even through process death – SavedStateHandle. This talk will use code examples to demonstrate:
• How to use SavedStateHandle to gracefully save and resurrect your ViewModel state through process death
• How to leverage Jetpack to automate state restoration with SavingStateLiveData