Vote count:
0
I have a demo app with two Activities. Parent is launched when the app starts, and Child is launched via a button in Parent. Child is set up with a transparent background so that Parent doesn't stop when Child launches.
I start the app, which launches Parent, then I start Child. Then I lock the device. I see that the Child calls onStop(), then the Parent calls onStop().
However, if instead of locking the app, I rotate the device, which triggers an orientation change, then when I lock the app only the Child calls onStop(). After I unlock the app, and hit the back button, both Child and Parent call onStop(), so the Parent Activity is in this weird state where it's not visible, but it hasn't called onStop().
- Why is this happening?
- How can I get Parent to call onStop() when the device is locked?
I've created a simple Android project to demonstrate the problem I'm seeing.
Parent Activity normally stops on lock, but not after orientation change
Aucun commentaire:
Enregistrer un commentaire