No Worries! Handling Don’t keep activities in the Compose era
summary
Shows how to handle Android low-memory activity kills in Jetpack Compose by recreating kills with Developer Options and applying concrete fixes: use rememberSaveable instead of volatile remember (demo shows it survives activity destruction), store UI state in ViewModel via SavedStateHandle, and pass IDs in navigation arguments to save bundle space. Notes a Navigation Compose bug (e.g., 2.7.0.01) and recommends keeping bundle payloads small (around 50 KB) or using Room/DataStore for larger or shared persistence.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:05Don’t keep activities
- 3:14Activity destruction low memory
- 7:53Need for Don’t keep activities
- 10:46UI state preservation basics
- 13:14SavedState API overview
- 17:09Remember Saverable implementation
- 21:06SavedState API history alternatives
- 22:35OS activity destruction cases
- 24:22Config changes handling
- 25:04Low memory SavedState
- 25:47SavedState vs storage
- 30:50Nested UI state structure
- 33:21Bundle limits navigation
- 35:50Screen transition results
- 38:19Summary best practices








