when is onRestoreInstanceState called?

后端 未结 6 861
有刺的猬
有刺的猬 2020-12-01 08:49

Sorry for my incomprehension, but I am new in the android development.

I have an application with activity A and activity B in it, and I go from activity A to activi

6条回答
  •  我在风中等你
    2020-12-01 09:49

    This happens because you are navigating the hard way. If you used the phone's default back button navigation, your onCreate would get the bundle passed in.

    To circumvent this issue, I suggest you save your state to shared preferences as well as a back up. When the bundle is null, restore it from the shared preferences.

提交回复
热议问题