Dynamic and persistent data
It is stated in documentation that onSaveInstanceState(Bundle)
is called before placing the a开发者_如何学Pythonctivity in such a background state, allowing you to save away any dynamic instance state in your activity into the given Bundle. Note that it is important to save persistent data in onPause()
instead of onSaveInstanceState(Bundle)
.
What is the best way to distinguish dynamic data with persistent?
Persistent data is data that must survive application restart, like user settings, etc..
Another way of looking at this: Dynamic data is only stored in RAM. Persistent data can survive device power-off.
精彩评论