How do games detect lost focus (such as opening notification pane) on Android
For example in game Asphalt 9, when the player swiping down the notification, the game is paused.
I have tried onPause, but it only fired when I switch to another app / activity. It doesn't detect something like opening the notification pane.