onDestroy() while “waiting” for onActivityResult()

前端 未结 1 1965
春和景丽
春和景丽 2020-12-15 07:21

I have an app with two activities: \"A\" and \"B\".

\"A\" uses startActivityForResult() to spawn \"B\" i.e. it waits for \"B\". Now, assume that \"B\" i

相关标签:
1条回答
  • 2020-12-15 07:33

    If Activity A gets killed by the time B finishes, you are guaranteed that

    1. A will be re-created.
    2. A will deliver the result.

    In other words, A will be re-created the next time the user visits/needs it, and at that point any pending results will be delivered (from B to A).

    Also note that this is why results must be returned through a single Activity callback with an integer request code, instead of an arbitrary callback object.

    0 讨论(0)
提交回复
热议问题