I encountered somewhat confusing situation, so I wanted to ask a principle behind it.
scenario : I have two activities A and B. A is a launcher activity and A starts B activity. I wanted to finish B activity and start B again. the situation I called confusing starts here. the normal scenario is I assume
- B-onPause
- A-onStart
- A-onResume
- B-onStop
- B-onDestroy --> starts B
- A-onPause
- B-onCreate
- B-onStart
- B-onResume
- A-onStop
but when I simulate this scenario as fast as possible(with my finger), this order does not remain. like this
- B-onPause
- A-onStart
- A-onResume
- A-onPause
- B-onCreate
- B-onStart
- B-onResume
- A-onStop
- B-onStop
- B-onDestroy
I know that if activity A starts Activity B, the following order is fixed one (A-onPause -> B-onCreate -> B-onStart -> B-onResume). Except resume and pause, another lifecycle callbacks are undeterministic?
I can simultate this on low-spec android device, but not on regular mid,high-spec device.
so one line question is : when finishing and reopening activity, onStop and on Destroy can be done after onResume callback?
thanks in advance and sorry for bad english :)