~/talk

Handling configuration changes in Compose

Talkat droidcon New York 2025 · 2025-06-25..06-26· [android]
github:alexvanyo
slides:none on file

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

  1. 0:00Introduction
  2. 3:16Android config manifest options
  3. 7:56Config changes without recreation
  4. 11:49How Compose handles changes
  5. 13:55Config handling pitfalls
  6. 17:06Interoperability with Views
  7. 18:10State during resizing
  8. 22:03Testing config changes
  9. 23:25Opting out of recreation
  10. 29:00Safe adoption tips
  11. 31:30Risk assessment types
  12. 38:11Best practices for config changes
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.