Frustration-free orientation changes
summary
Explains why orientation rotation destroys an Activity and gives concrete fixes: how much to put in onSaveInstanceState (bundle size limits), when to use onRetainNonConfigurationInstance or headless retained fragments, and how modern Android Architecture Components like ViewModel and LiveData let an in-memory cache survive recreation. Demonstrates pitfalls: losing async load results, fragment-transaction crashes after onSaveInstanceState, process-death during startActivityForResult, and practical testing tips (background process limit, developer options) plus which approach actually avoids user-visible rework.
AI-written summary · about
chapters (19)
- 0:00Intro
- 1:31Frustration
- 4:27Handling orientation changes
- 8:00Handling configuration changes
- 13:09Handling configuration changes manually
- 13:25Quitting processes
- 14:21Framework
- 15:43Limitation
- 16:57Restore State
- 17:25Safe State
- 17:55Platform widgets
- 19:26What is safe
- 19:42What is not safe
- 21:16Consequence
- 25:13Dont hold on to
- 26:18Frozen step example
- 28:06Multiprocess step example
- 30:26Manual testing
- 32:07Other settings
related talks
23mMaster of Lifecycle
30mSurviving a discontinuous world
23mNot Just Rotation: Configuration Changes on Android
45mFalsehoods Android Developers Believe About Lifecycles
46mModern Android: How to ditch Activities and Fragments
24mWhere did my State go
39mClean app design with Architecture Components
41mViewModels, LiveData and Lifecycles, oh my!
