开发者

How to save a Bundle?

开发者 https://www.devze.com 2023-03-02 12:15 出处:网络
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?onPa

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

精彩评论

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

关注公众号