If your stack looks like this:
A->B->C->D
and you start activity B from activity D (without using any special launch flags) then a new instance of activity B will be created and your stack will look like this:
A->B->C->D->B
where there are now 2 instances of activity B in the stack (these are 2 different objects!).
If you now press the BACK button, you will return to activity D and your stack will look like this:
A->B->C->D
If, however, your stack looks like this:
A->B->C->D
and you start activity B from activity D (using Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
) then the existing instance of activity B will be moved to the front and your stack will look like this:
A->C->D->B
If you now press the BACK button, you will return to activity D and your stack will look like this:
A->C->D
If, however, your stack looks like this:
A->B->C->D
and you start activity B from activity D (using Intent.FLAG_ACTIVITY_CLEAR_TOP
) then activities B, C, and D will be finished and a new instance of activity B will be created and your stack will look like this:
A->B
If you now press the BACK button, you will return to activity A and your stack will look like this:
A