什么时候应该用onSaveInstanceState或者是onPause来保存状态?

引用
Basic rule to follow - use onSaveInstanceState if you want to put data into a bundle to be by onCreate. Use onPause to write persistent data that can be read during onResume.

In your case you will probably want to put most of your suspend logic in onPause. I find that I almost always use onPause for most suspend logic since my apps (games) don't usually reduce to something that can fit into a bundle easily.

你可能感兴趣的:(什么时候应该用onSaveInstanceState或者是onPause来保存状态?)