~/talk

Where did my State go

Talkat 360|AnDev 2020 · on Friday, 2020-07-24· [android, frontend-architecture]
links:none on file
slides:none on file

Activities, fragments and views keep getting recreated for reasons beyond rotation: toggling Dark Theme triggers a UI mode configuration change that recreates started activities, multi‑window forces different lifecycle states so onPause/onResume is unreliable for media, and background process death destroys memory (no workaround). ViewModel survives recreation but not process death so use SavedStateHandle (via SavedStateViewModelFactory) for persistence; custom views must implement BaseSavedState and set IDs. Test these with AndroidX testing using launchFragmentInContainer and Scenario.recreate or moveToState; opt out of multiwindow with resizableActivity=false or declare configChanges=uiMode as a last resort.

AI-written summary · about

  1. 0:00Introduction
  2. 2:00Dark Themes
  3. 4:30MultiWindow
  4. 11:25View Models
  5. 18:15Testing
~/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.