How to detect if came back from child activity?

后端 未结 4 996
南旧
南旧 2021-02-20 06:35

How can I detect if an activity came to focus after pressing the back button from a child activity, and how can I execute some code at that time?

4条回答
  •  花落未央
    2021-02-20 07:08

    One possibility would be to start your child activity with startActivityForResult() and implement onActivityResult() which will be called when you return from the child activity.

提交回复
热议问题