Sending Activity to background without finishing

The following will work if the Activity is running in a different task to its parent. To achieve this, see http://developer.android.com/guide/topics/manifest/activity-element.html#lmode.

public void onBackPressed () {
    moveTaskToBack (true);
}

The current task will be hidden, but its state will remain untouched, and when it is reactivated it will appear just as it was when you left it.

Leave a Comment