开发者

How to save a Bundle?

Which one is better to save Bun开发者_如何学Godle: OnSaveInstanceState or OnPause in order to save Bundle in case or rotation and redrawing of a GridView containing images that have been modified?


onPause() is called whenever your activity loses it's foreground status, and subsequently when it comes to the foreground, it's counterpart onResume() is called. So, this is where you would check your UI-related information (eg. updating).

onSaveInstanceState() is where you should save your Bundle. The retrieval of your bundle (activity state info) can be done in either onCreate() or onRestoreInstanceState().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜