How do I remove the last activity from the stack?
There are several ways to do this.
If you know what activity you don't want to remove from the stack, all you have to do is call
after your call
for the next action, so this action will be excluded from the stream, see example below:
Intent intent = new Intent(...); startActivity(intent); finish();
If the decision will be based on user interaction, you can call
to start the next action, and when the action ends, you must return a RESULT.
Here is some good documentation on how to use
source to share