Is onStop() always preceded by onPause()

后端 未结 2 664
别跟我提以往
别跟我提以往 2020-12-16 03:06

I have read that a call to onStop() is always preceded by a call to onPause() no matter what the scenario is. Reference: Figure 1 on http://developer.android.com/training/ba

2条回答
  •  忘掉有多难
    2020-12-16 03:42

    Yes, the onPause() method will always be executed. In fact, it is the only method that is guaranteed to be called when your activity is losing focus/stopped/destroyed.

    Check out this page: Activity

    onResume()
    Called when the activity will start interacting with the user again. At this point your activity is at the top of the activity stack, with user input going to it. Always followed by onPause().

提交回复
热议问题