I'm launching an activity (ActivityA
) using the technique described here with FLAG_ACTIVITY_CLEAR_TOP|FLAG_ACTIVITY_SINGLE_TOP
. This works if all of the activities on the back stack are still in memory. ActivityA
is shown and if I tap back, the app exits.
If I use SetAlwaysFinish
to make paused activities be immediately finished and repeat my test, then when I tap back in ActivityA
, I'm taken to the previous activity. This shouldn't happen.
Am I testing realistic conditions when I use SetAlwaysFinish
? If so, how do I configure and launch ActivityA
so that the back stack is really cleared and my test works under both conditions.