State of Activity while in onActivityResult question

前端 未结 2 2027
梦谈多话
梦谈多话 2020-12-09 06:23

I have a question about the Activity\'s state while in onActivityResult. Specifically, is it \'guaranteed\' that either onRestoreInstanceState or onCreate have been called

2条回答
  •  庸人自扰
    2020-12-09 06:56

    In my app I get the following workflow:

    onCreate
    onStart
    onRestoreInstanceState
    onActivityResult
    onResume
    

    So, yes onActivityResult is called AFTER the onRestoreInstanceState, so you can count on the state has been fully restored (unless you do smth in onResume).

提交回复
热议问题