~/talk

Collecting flows in a lifecycle-aware manner

Talkat Android Dev Summit 2022 · 2022-10-24..11-14· [android]
slides:none on file

Explains how to stop and start Flow collection based on Android lifecycle by using repeatOnLifecycle, flowWithLifecycle, and collectAsStateWithLifecycle; repeatOnLifecycle spawns a coroutine at a given Lifecycle.State (commonly STARTED), cancels it when falling below that state and only returns when the lifecycle is destroyed; flowWithLifecycle is implemented with repeatOnLifecycle plus callbackFlow; collectAsStateWithLifecycle (alpha) wraps produceState for Compose so emissions update Compose state only while visible.

AI-written summary · about

  1. 0:00Introduction
  2. 0:55Collecting in a lifecycleaware manner
  3. 2:17Collecting flows manually
  4. 2:42Lifecycle Libraries
  5. 3:20Repeat on Lifecycle
  6. 4:20Flow with Lifecycle
  7. 4:48Implementation details
  8. 5:11API
  9. 5:43Summary
~/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.