In my program I start with activity A, then launch activity B from there. However, I then want to launch another instance of activity A on top, and when the user clicks back, I want it to take them to the first instance of Activity A. So I tried launching a new instance of activity A then calling finish(), but it ends up never launching the new activity and just finishing activity B, taking me back the first instance of activity A.
This all works fine when all three activities are different, but when the first and last ones are the same, that is where the problem appears.
Also, I checked and the launch mode for activity A is "standard". I am able to directly launch a new instance of activity A from itself.
So I tried launching a new instance of activity A then calling finish(), but it ends up never launching the new activity and just finishing activity B
Then your code sounds broken elsewhere. Calling startActivity()
and then finish()
would work as expected