android-lifecycle
android-lifecycle copied to clipboard
onSaveInstanceState() vs onRestoreInstanceState()
onSaveInstanceState() will be called anytime before onStop() . onRestoreInstanceState() only will be called when the activity is actually been rescycled.
1/ Documentation claims onSaveInstanceState will occur (if ever) before onStop, not onDestroy. I think you are right. http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState%28android.os.Bundle%29
2/ Not only onRestoreInstanceState as you mention but onSaveInstanceState are both conditional; which is shown in the diagram. I don't see an issue here.