Familiar scenario: I have a Main activity that launches a Game activity when a button is pressed. If the user presses HOME, and then launches my applicatio
I solve the problem using the following activity stack in my application:
LaunchActivity -> MainActivtiy -> SomeSubActivtiy
LaunchActivtiy only verifies some parameters and launches MainActivtiy. It turned out, that MainActivity must be launched with
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
That combination of flags on MainActivity gives desired behaviour.