My app has 4 activities on the stack A->B->C->D (top)
If you press home and re-enter the application, another instance of A
is started, so the stack is A->B->C->D->A (top). I know this because
when I press BACK, A is popped off and I now see D (instead of going
to the Home screen).
What I want is that when the user re-enters the app, they re-enter on
the same activity they were in before (D). How do you do that?
have you found a solution? I have the same problem and understand what you are trying to achieve.
Android seems not to have docs describing this problem and FLAG_ACTIVITY_CLEAR_TOP will not solve it since you want to stay with D and not pop everything down to A. I have achieved the stay with D by exiting the second A call in onCreate() (with finish(); return;) experimentally in the debugger but this is not a solution.