I'd like to detect if a system dialog (powerdialog and low battery dialog, I think they're the only important one!) has shown. At the end I would like to pause my game, like it's done in Asphalt 7. So there must be a way to detect it, but I haven't found a solution yet.
I know that onPause()
will be called if another activity comes to foreground, but it isn't called when the powerdialog becomes visible. And AFAIK I don't have to observe the battery state. I've already read this post, but there's no final answer.
So, what is the best solution to detect when these dialogs are appearing? Do I have to add a broadcast intent?