singleTask and singleInstance alone are not the answer.
I have activities in a stack ... n, n+1, n+2
elements in n+2
can open n+1
this creates stack
... n, n+1, n+2, n+1
I want it to create stack
... n, n+2, n+1
, where n+1
is moved to the top of stack
singleTask creates this stack
... n, n+1
and singleInstance creates this stack
n+1
where all previous activities are closed.
neither of which I want.
is there any launch mode I can use?
FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
only makes it so that this activity isn't loaded again from scratch, but doesn't clear the duplicate activity in history, maybe there is a combination of flags I can use? or I can possibly locate that activity in the index of the activity stack and remove it if it isn't the most recent activity ?