Android onStop/onDestroy - when might these be used?

后端 未结 3 883
萌比男神i
萌比男神i 2021-02-14 08:21

Looking at the Activity Life Cycle diagram, I notice that onPause() and onStop() can both lead to the \"process\" being killed. This would require

3条回答
  •  醉酒成梦
    2021-02-14 08:27

    Another example would be to register and unregister a broadcast receiver.

    Note that usually these things are placed in onResume and onPause, the difference is subtle though, onResume/onPause are called when the activity gets placed behind another activity, onStart/onStop are called when the activity is no longer visible in the screen.

提交回复
热议问题