I have an Activity A and Activity B. Activity A starts Activity B.
Is there a guarantee that A's onPause() will always be called before calling B's onResume()?
This is related to this entry
I have an Activity A and Activity B. Activity A starts Activity B.
Is there a guarantee that A's onPause() will always be called before calling B's onResume()?
This is related to this entry
Found the answer here:
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.
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
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. If navigating to Activity B
is for the first time, then Activity B
's onCreate()
will be called after Activity A's onPause()
. Take a look at Activity's Lifecycle for clear understanding.