I am trying the new Android P Developer Preview, and the secenario is as follows:
(Here also a post that confirms this order Execution order of OnActivityResult and OnResume) answer from rndstr
Now While testing the Android P Preview the Activity lifecycle is:
Android Documentation https://developer.android.com/reference/android/app/Activity#onactivityresult says only that onActivityresult should come before onResume, it says nothing about onStart
can anybody help ? is this a bug in Android P Preview or this is a new behavior? is there a good documentation for this?
I am using targetSDK: 23
Activity A is: SingleTask and Activity B is: SingleTop
It sounds to me like you've answered your own question!
The documentation says only that
onActivityResult()
will be called beforeonResume()
, it says nothing aboutonStart()
.
onStart()
and onStop()
are only called if your Activity
is not visible. This means that if you launch another Activity
and that Activity
does not completely cover the screen, your Activity
will NOT get the onStop()
, onRestart()
and onStart()
calls anyway. Therefore you should not rely on them and you should not rely on the order in which they are called.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With