Master of Lifecycle
summary
Explains Android lifecycle issues that cause battery and memory waste—e.g., a long‑lived Activity retaining a short‑lived Fragment or coroutines not being cancelled—and shows fixes validated with Memory Profiler showing retained Activity instances. Covers using ViewModel with SavedStateHandle for rotation/process survival, LiveData builder cancellation behavior, and making Kotlin Flow behave like LiveData via stateIn + flowWithLifecycle or using repeatOnLifecycle / launchWhenStarted to stop background work.
AI-written summary · about
chapters (8)
- 0:00Lifecycle importance
- 2:08Understand lifecycle
- 5:42Prevent memory leaks
- 10:56Activity lifecycle
- 15:10ViewModel and LiveData for UI
- 18:49Flow vs LiveData behavior
- 21:18LiveData vs Flow usage
- 22:23Resource efficiency
related talks
36mLifecycle for Android Developers
45mFalsehoods Android Developers Believe About Lifecycles
41mViewModels, LiveData and Lifecycles, oh my!
23mLifecycle, LiveData, Viewmodels - The inner wiring
33mThe A,B and C of Lifecycle Components
28mLifecycle, LiveData, ViewModels - The inner wiring
39mFrustration-free orientation changes
38mActivities in the Wild: Exploring the Activity Lifecycle
