Reputation: 501
I have 3 activitys (A, B, C), the flow is:
A -> B -> C
when i click to back, the flow is:
C -> B -> A
but i want this:
C -> A
not
C -> B -> A
how?
Upvotes: 3
Views: 1362
Reputation: 7198
There are a few ways to do this.
finish()
after your call startActivity(intent)
to the next activity, so this activity will be excluded from the flow, see the example below:
Intent intent = new Intent(...);
startActivity(intent);
finish();
If the decision will happen based on an interaction with the user, you can call startActivityForResult()
to start the next activity, and when the activity ends, you have to return a RESULT value.
Here's a good documentation about how to use startActivityForResult()
:
http://developer.android.com/training/basics/intents/result.html
Upvotes: 5