I use these functions in an activity class:
onSaveInstanceState
onRestoreInstanceState
onPause
onCreate
When the user starts the Activity onCreate gets called, when the user ends, onPause gets called. Thats fine so far.
But when the user rotates the phone,
onPause
onSaveInstanceState
onCreate
gets called. I would have expected onRestoreInstanceState before onCreate. Why is this so and how should I handle initialization of ui-data if not there?
The documentation for
onRestoreInstanceState()clearly states:If you wish to initialize your UI with stuff from the
BundleinonCreate(), feel free to do so.