I have an activity that starts some other activities for results, so when the result comes back, the activity may or may not have been destroyed and recreated.
I have overridden onSaveInstanceState so as to add the data that needs to be preserved and restored.
When the activity gets destroyed and recreated, onCreate is passed the savedInstanceState bundle; but also onRestoreInstanceState() is called and passed the same bundle.
So where should I put the code that extracts the data from the bundle and restores the state? In onCreate or in onRestoreInstanceState? Is the latter guaranteed to be always called?
Is it possible that onRestoreInstanceState is called without calling onCreate? (e.g. if the activity gets stopped and restarted but not destroyed and recreated)?