0

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:

  1. When the problematic activity is called in not-split-screen mode, but finishes in split-screen mode. (both resumed and paused)
  2. 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:

  1. 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.

Cheolho Jeon
  • 359
  • 1
  • 12
  • "when certain activity quits... and my activity is not tapped (i.e., my activity is in paused state)" -- in what circumstances would this activity "quit" when it "is not tapped"? – CommonsWare Dec 30 '16 at 13:35
  • @CommonsWare It receives a signal from server. This activity can start and end in two ways: one, user starts/ends it. Two, server tells them to stars/end a activity. The behaviour is pretty much like android phone call. It can quit even when screen is off. – Cheolho Jeon Dec 31 '16 at 19:11
  • It would not surprise me if this is a bug in Android's multi-window implementation. – CommonsWare Dec 31 '16 at 19:24
  • do you think I should report this to Google? Or in other words, is this a problem worth bothering them? – Cheolho Jeon Jan 02 '17 at 01:48
  • If you can create an app that can reliably reproduce the problem (given a certain set of actions on the part of the tester), I suggest [filing an issue](https://b.android.com). If, OTOH, while the problem happens, you cannot reproduce it reliably, while you file an issue, you may be frustrated with the results. – CommonsWare Jan 02 '17 at 12:46
  • @CommonsWare I'll try. Thank you a lot for attention & advices. – Cheolho Jeon Jan 03 '17 at 02:21
  • @CommonsWare it was a defect in android os. Thanks. – Cheolho Jeon Jan 05 '17 at 09:17

1 Answers1

0

As it turns out it was a defect in Android OS.

Google's response is as below

Hi,
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks

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

Cheolho Jeon
  • 359
  • 1
  • 12