Config Changes & Process Death
ANDROID › Lifecycle
How Android recreates UI on config changes and process death, and what state survives each.
Interviewers use this to check whether you understand the difference between in-memory recreation and a full process kill, and which state-holder protects against which. It separates engineers who blindly add android:configChanges from those who reach for ViewModel, SavedStateHandle, and persistent storage correctly. Expect follow-ups on testing process death and on serialization limits.
What this covers
- What triggers a config change: rotation, locale, dark/night mode, screen/window size, font scale, keyboard
- Activity recreation vs system-initiated process death are distinct events with different survivors
- ViewModel survives recreation only; SavedStateHandle/rememberSaveable survive process death; disk survives everything
- Why saved state must stay tiny: Bundle ~1MB TransactionTooLargeException limit and main-thread serialization
- How android:configChanges and onConfigurationChanged work, and why they are not a fix for process death
- How to reproduce and test process death (Don't keep activities, adb am kill, background + memory pressure)
Study this topic
- Config Changes & Process Death explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Config Changes & Process Death interview questions and answers