onSaveInstanceState when click back button in Android
Hello 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 override the onSaveInstanceState method to save outState to be retrieved in a second time but onSaveInstanceState is never called when the user click the back button.
Do you know why this happens?
Thanks in advance
onSaveInstanceState()
is not supposed to be called when the user presses BACK.
It will be called when the user changes configuration (eg, 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.
链接地址: http://www.djcxy.com/p/31900.html