~/talk

Lifecycle for Android Developers

Talkat Chicago Roboto 2022 · on Wednesday, 2022-07-27· [android]
links:none on file
slides:none on file

Claims that collecting Kotlin flows naively wastes CPU and memory because StateFlow and SharedFlow keep emitting without collectors, demonstrates that launching collects in lifecycleScope or with launchWhenStarted continues producing while the UI is backgrounded, and shows concrete fixes: use repeatOnLifecycle / flowWithLifecycle and the newer collectAsStateWithLifecycle from lifecycle-ktx to automatically cancel and relaunch collectors tied to lifecycle states. LiveData contrasts and Compose collection caveats are shown with working examples and exact failure modes.

AI-written summary · about

  1. 0:00Lifecycle concepts
  2. 3:51Lifecycle owners and registry
  3. 6:56LiveData vs Flows
  4. 12:14Flows in UI problems
  5. 20:03Lifecycle-aware flow collection
  6. 27:10Repeat on lifecycle deep dive
  7. 33:11Compose lifecycle handling
  8. 35:19Summary and best practices
~/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.