[英]Activity starting another activity. Guarantee that the first activity's onPause will be called before second's onResume
onPause () onPause()
When activity B is launched in front of activity A, this callback will be invoked on A. B will not be created until A's onPause()
returns , so be sure to not do anything lengthy here 当活动B在活动A之前启动时,将在A上调用此回调。 在A的
onPause()
返回之前 , 将不会创建B ,因此请确保此处不要做任何冗长的操作
http://developer.android.com/reference/android/app/Activity.html#onPause() http://developer.android.com/reference/android/app/Activity.html#onPause()
Yes. 是。
Activity A
's onPause()
will be called before passing to Activity B
's onResume()
if the navigation is not the first time. 如果不是第一次导航,则将在传递给
Activity B
的onResume()
之前调用Activity A
的onPause()
。 If navigating to Activity B
is for the first time, then Activity B
's onCreate()
will be called after Activity A's onPause()
. 如果是第一次导航到
Activity B
,则将在活动A的onPause()
之后调用Activity B
的onCreate()
onPause()
。 Take a look at Activity's Lifecycle for clear understanding. 请看一下Activity的生命周期以了解清楚。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.