[quote]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.[/quote]
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.[/quote]
本文讨论了游戏应用程序在不同生命周期阶段的处理方式。建议使用onPause方法来处理大多数挂起逻辑,因为游戏状态通常无法简单地保存到Bundle中。此外,onSaveInstanceState用于保存数据以便在onCreate中恢复。

被折叠的 条评论
为什么被折叠?



