Deep Dive Into State Restoration (en) - Cyril Mottier, Capitaine Train - Droidcon Paris 2014
Why Stack Overflow recommends it
Stack Overflow users link it when explaining onSaveInstanceState, view state restoration and why handling configuration changes yourself is usually the wrong fix.
Recommended by 2 people across 2 different months, 2012 to 2018.
What it is
A 2014 Droidcon Paris conference talk by Cyril Mottier of Capitaine Train on how Android saves and restores application state when a process is killed for low memory or a configuration change. It focuses on Parcel and Parcelable and how the framework uses them to persist the full UI state.
What people said
Strong rec JJD · 2014-10 · Stack Overflow · on “Activity Save and Restore Instance State in partial visibility issue”
@ADK I highly recommend watching the talk by Cyril Mottier at Droidcon Paris 2014 [LINK] . Here is the video recording of "Deep Dive Into Android State Restoration" [this video] .
Recommends NazarK · 2014-11 · Stack Overflow · on “Purpose of onSaveInstanceState() in activity lifecycle”
You can watch this video about restoration - [this video] . But in a nutshell android can restore view's state by traversing all views in the hierarchy and get their values(in your case EditText value). And one important thing - views have to have set ids. These methods can be useful when you want to store variables in your activity. For example - you're implementing book reader and you might want to save view_mode(night_mode/day_mode) that user selected.
Cites Cyril Mottier · 2012-12 · Stack Overflow · on “How to persist Marker from Google API Android v2?”
Marker s are not part of the "UI state" and hence shouldn't be saved/restored on configuration change. On configuration change, you will simply recreate all Marker s using the exact same code you used to populate the GoogleMap the first time it has been displayed. If you really want to persist them (which is a really bad idea from my point fo view), this is still possible by doing so manually in onSaveInstance(Bundle outState) Edit: See "Deep Dive Into Android State Restoration" [this video]
Cites Stephen · 2018-07 · Stack Overflow · on “App Crash on Orientation Change (just when I set 2 different backgrounds for portrait and landscape modes)”
This answer is not a solution to the problem, it merely avoids the problem by preventing android from handling these configuration changes and leaves it up to you the developer to deal with them. To do properly though is more work that properly saving state. Generally it is not advised unless you have a specific use case for it. See more here: [this video]