Activities in the Wild: Exploring the Activity Lifecycle
summary
Concrete rules about Android activities and when state actually lives are shown using a ticker app that loses its count on rotation unless state is stashed, and by reproducing a process kill when another app (Pokémon Go) consumes memory. The concrete claim is that transient UI state must go into a Bundle via savedInstanceState so onCreate can restore it because onDestroy is not guaranteed; onStop is the last guaranteed callback. Examples cover when to init/teardown resources, location sampling, and when to pause versus stop video playback.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:54Activity Lifecycle
- 7:06Activity Lifecycle Examples
- 8:58Teardown Cycle
- 10:43Android
- 16:44Summary
- 20:11Saving Instance State
- 21:32Activity Record
- 24:25Activity Structure
- 27:40Examples
- 29:58Video Playback
- 31:20Capstone Challenge
related talks
34mThe Life and Death of an Android Activity
45mFalsehoods Android Developers Believe About Lifecycles
23mMaster of Lifecycle
24mWhere did my State go
30mSurviving a discontinuous world
37mSingle Activity by Example
40mNo Worries! Handling Don’t keep activities in the Compose era
39mFrustration-free orientation changes
