Is this possible in an Android app? I want to make sure that no matter how many times the user launches ActivityA, when they click the back button, they will never get more than one activityA action.
What I find in my current code is that I have only two options: 1. I can call finish () in activityA, which will prevent it from being accessed through the back button completely or 2. I don't call finish (), and then, if the user starts activityA (n) times during their use, when you click the "Back" button there will be (n) instances.
Again, I want Activity A to be available by clicking the back button, but there is no reason to keep multiple instances of the same activity on the stack. Is there a way to limit the number of activity instances in the queue to only 1?
source
share