I have been struggling with this bug for days. This bug happens under rare but likely condition and I just cannot find why this is happening.
What happens is:
In split screen mode (my app at top and another at bottom), when certain activity quits, back-stack activity's (in my case, mostly MainActivity) onStart()
is never called, and split screen mode looks like it's ended because my app is dead, but the overview button still looks like I'm in split screen mode and when I tap the split screen button, my MainActivity's onStart()
is finally called, and it's back to split screen mode again.
The log looks like
MainActivity onStop()
ProblematicActivity onCreate()
...
ProblematicActivity onDestroy()
//and nothing!
This does not happen under these conditions:
- When the problematic activity is called in not-split-screen mode, but finishes in split-screen mode. (both
resumed
andpaused
) - When the problematic activity is called in split-screen mode, but my app is tapped (i.e, my activity is in
resumed
state)
This happens only when:
- Problematic activity is started in split-screen mode, and my activity is not tapped (i.e., my activity is in
paused
state)
I've checked activity lifecycle callback thoroughly (at least I think so) and looked into logs many times but I just cannot figure out why BackStack activity is not called.
I've tried searching but there were no much helpful information. Did anyone had any experience/problem similar to mine?
Thanks.
additional Info
My activity stack looks like this
MainActivity
Activity 2
Activity 1
Fragment 1
Server sends my app to start a feature, then it starts Activity 2, it starts activity 1, and Fragment 1 is in activity 1 (what user really sees is fragment 1) Activity & fragments are well-destroyed until Activity2. But From there, MainActivity (or no matter what activity it is) is not visible since AndroidSystem never calls onStart
.
As it turns out it was a defect in Android OS.
Google's response is as below
Issue link:
https://code.google.com/p/android/issues/detail?id=231337&can=1&q=reporter%3Aadobecs5&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened