I'm developing an app on 2.2.2, and need to take certain actions when the screen blanks, user presses 'home' etc.
Most of this is fine: when screen blanks, onPause() is called, then onResume() on an unblank, and if home is pressed it goes onPause(), onStop() etc.
However, that is all true for the main activity, it doesn't seem to apply as clearly for a secondary activity, started from the launch activity.
Screen blank / unblank works as expected, however on a 'home' key press only onPause() is called, not onStop() as well, and then restarting the app causes an onResume().
Ie, I cannot tell the difference between a screen blank and back to home screen from this secondary activity, and I need to, the reason being I need to carry out certain actions on a return to home, but not on a screen blank.
What could I do to find out?