Process death and state restoration in ViewModels
summary
Shows that ViewModel + Jetpack saved‑state (SavedStateHandle) plus minimal persisted keys reliably restore UI after a real process kill; demonstrates problems with naively serializing large results into bundles (causes transaction too large), builds a sample fragment that survives rotations and full process death, and tests restoration with adb shell am kill, Android Studio terminate and the Venom helper. Integrates factories via Dagger assisted inject (and notes Hilt removes boilerplate) and proves the approach works.
AI-written summary · about
chapters (14)
- 0:00Introduction and agenda
- 1:59Process lifecycle basics
- 4:53Process priority categories
- 7:47Activities and singletons limitations
- 10:16Saving state callbacks
- 13:29Bundle behavior and limitations
- 15:43State persistence strategies
- 20:21Testing process death scenarios
- 24:01Basic ViewModel implementation
- 25:45Surviving process death with SavedStateHandle
- 29:39Introducing SaveStateModule
- 33:36Assisted injection simplification
- 36:05Hilt integration overview
- 38:00Q&A and closing
