~/talk

Fragments: The good (non-deprecated) parts

Talkat Google I/O 2022 · 2022-05-11..05-12· [android]
links:none on file
slides:none on file

Fragments now give concrete pieces: use AndroidX lifecycle with repeatOnLifecycle to auto-start/stop work in ViewPager pages, put long‑lived state into ViewModels (fragment or parent scope), pass results with the fragment result APIs mediated by FragmentManager, and test with FragmentScenario plus injected FragmentFactory and fake ActivityResultRegistry via registerForActivityResult. Replace action bar coupling with the MenuHost + MenuProvider pattern, and detect deprecated usage at runtime with FragmentStrictMode instead of relying on fragment-only APIs.

AI-written summary · about

  1. 0:00The evolution of fragments
  2. 1:01Modern fragment architecture
  3. 2:05Lifecycle and state management
  4. 4:04ViewModels in fragments
  5. 6:15Result and testability APIs
  6. 8:45Dependency injection and testing
  7. 12:22Menu and app bar integration
  8. 15:20Fragment strict mode
~/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.