Normally, Android calls onPause on your Activity when it starts to hide or hide, and then onStop when it no longer displays. In my game, I pause the game in onPause , so the user does not lose the game by looking elsewhere.
However, when the user drags the notification bar, it closes my Activity , but neither onPause nor onStop . This does not seem to be mentioned in the documentation. The game disappears in the background and no one is looking at it. Is there any other way to say that my Activity was hidden when this happens, so I can pause the game before the user loses? I can not find anything about this on the Android developer site.
source share