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()
.
精彩评论