Hi Stackoverflowers (I know, that doesn\'t sound like it should...)
Well I think It\'s almost all in the question: I\'d like to catch anything that causes the displa
I was pretty sure onPause() would be called when such events happen, but it seems to be wrong... or is it me?
onPause()
will be called if another activity takes over foreground input. So, if a third-party app came to the foreground, even with a dialog-themed activity, onPause()
would be called.
There is no requirement for onPause()
to be called from OS components, though.
I'd preferably not hook on each system broadcast action individually, since I'd like to be as generic as possible (and react to ANYTHING that hides my Activity).
What you want is not possible. Not all of the things you list have broadcast Intents
, and there are other techniques that people can use (e.g., Toasts
) that will obscure part of your activity of which you will have no knowledge.