How to detect “Recent Apps” system button clicks (Honeycomb+)

None of standard Activity Lifecycle methods is called when “Recent Apps” button pressed. Activity will stay active after list of recent apps popups. Through semi-transparent left part of this list you can even observe application animation is still running, if you running a game with some animation that didn’t handle this situation properly. Actually many of games in Google Play didn’t handle this situation properly, even good ones, like Angry Birds.

The only Activity method are getting called when user opens “Recent Apps” list (or returns from it) is onWindowFocusChanged with boolean parameter hasFocus. When user open list of Recent App method onWindowFocusChanged() called with hasFocus equals false, and same method called with hasFocus equals true when user pressing Back in this list.

Leave a Comment