Not Just Rotation: Configuration Changes on Android
summary
Android configuration changes include orientation, window/screen size, UI mode, font scale and pixel density, external displays and foldables, and keyboard presence; rotation is only one. Options: rely on onSaveInstanceState (limited to primitives and can be slow under rapid resizes), keep UI state in memory with ViewModel (fast but loses state if process is killed), or declare and implement onConfigurationChanged (no recreation, highest complexity). Example: picture-in-picture plus bottom navigation required copying Configuration via setTo and inflating alternate layouts; recommendation is ViewModel plus instance state and heavy testing.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:16Configuration Properties
- 4:13Configuration Changes
- 7:43Handling Configuration Changes
- 11:37View Model
- 13:00Configuration Change on Your Own
- 13:42Screen Size
- 15:12Picture in Picture
- 16:30Code
- 19:15Saving Instances
- 21:21Conclusion
related talks
39mFrustration-free orientation changes
24mWhy is my app letterboxed?!
28mBuilding Robust Screens That Handle Window Size Changes
46mA developer's guide to large screens readiness
39mHandling configuration changes in Compose
30mTablets, Desktops, Foldables Oh My!
23mAndroid Complexity
35mBuild apps for foldable, multi-display, and large-screen devices
