Issue
I have an activity that is called at runtime in an Android App. When the user clicks the back button the Activity is destroyed and I overrode the onSaveInstanceState
method to save outState
to be retrieved in a second time but onSaveInstanceState
is never called when the user clicks the back button.
Do you know why this happens?
Solution
onSaveInstanceState()
is not supposed to be called when the user presses BACK.
It will be called when the user changes configuration (e.g., rotates the screen), if Android believes that the activity is at risk of being destroyed while still being reachable on the stack, and perhaps a few other cases.
Answered By - CommonsWare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.