Handling configuration changes in Compose
summary
Explains that Android 16 lets apps opt out of activity recreation for all config changes using resourcesUnused / allKnown and that Compose handles updates by exposing a snapshot backed LocalConfiguration.current (use localResources or stringResource instead of context.resources and remember keys for formatters). Gives concrete fixes: use key(configuration) to recreate AndroidView, preserve anchor target when window size changes, test with deviceConfigurationOverride. Recommends opting out when you honor the promise, start with low‑risk changes like keyboard.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 3:16Android config manifest options
- 7:56Config changes without recreation
- 11:49How Compose handles changes
- 13:55Config handling pitfalls
- 17:06Interoperability with Views
- 18:10State during resizing
- 22:03Testing config changes
- 23:25Opting out of recreation
- 29:00Safe adoption tips
- 31:30Risk assessment types
- 38:11Best practices for config changes
related talks
40mNo Worries! Handling Don’t keep activities in the Compose era
43mSwitching to Compose? Don’t Rush!
22mModern Android Development #AskAndroid
43mBuilding for the Future of Android
35mSomething old, something new: Adding Jetpack Compose to a large open source Android app
37mSomething old, something new: Adding Jetpack Compose to a large open source Android app
49mAndroid Fireside Chat
23mNot Just Rotation: Configuration Changes on Android
