Fear No Fragments
summary
Shows concrete fragmentation patterns: managing fragment transactions and the back stack, using child fragment managers to avoid confusing hierarchies, and preferring ViewModel for async state to avoid IllegalStateException. Demonstrates headless fragments for retained work and a pragmatic trick to persist a WebView by hide instead of replace so the hybrid World Cup app keeps its web app alive. Includes lifecycle checkpoints to check isAdded and examples of commit vs commitAllowingStateLoss.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:44DEMO: WORLD CUP CATCH UP
- 3:27Goal For Today
- 3:423 Components
- 9:02Activity/Fragment Lifecycle
- 10:04First Lesson
- 11:14Navigation
- 12:54Example - Pressing Back
- 17:20Lesson #2
- 20:50Lesson #3
- 21:06Solutions?
- 25:42DialogFragment
- 27:11HeadlessFragment
related talks
37mWhat To Do About Fragments? (en)
56mYou've been told lies about Fragments
30mFragments: What are they good for.
18mFragments: The good (non-deprecated) parts
46mAndroid Jetpack: How to smartly use fragments in your UI
31mFragments — As Incredible as It Seems
32mAn alternative to fragments: Say Hello to Mortar & Flow
24mMVVM & Nested Fragments/Views: ViewModel Contracts
