I think you are reading the description of onSaveInstanceState()
incorrectly, if you think it is not called when you need it to be
called. From the documentation on Activity:

"In addition, the method onSaveInstanceState(Bundle) is called before
placing the activity in such a background state, allowing you to save
away any dynamic instance state in your activity into the given
Bundle, to be later received in onCreate(Bundle) if the activity needs
to be re-created."

that seems to be what you want, and that sentence is very clear: "is
called".


On Jan 13, 2:28 am, Android Developer <[email protected]>
wrote:
> Hi,
>
> Is it possible to use bundle and save the data in OnPause() lifecycle
> method?
> The scenario is i have 2 edit text and have entered some data
> i want to retain the data when the activity is killed and started
> again.
>
> This can be achieved using onSaveInstanceState() but as documentation
> says, this method is not a lifecycle method and hence the callback is
> not guaranteed.
>
> So i wanted to know if there is a way to save it using Bundle in
> onPause().
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to