Exclude an activity from back-stack history
suggest changeActivity B can be opened and can start further activities. The user should return to the activity that opened B, skipping B, when navigating back.
The simplest solution is to set the attribute noHistory to true for that <activity> tag in AndroidManifest.xml:
<activity
android:name=".B"
android:noHistory="true" />
This same behavior is also possible from code if B calls finish() before starting the next activity:
finish();
startActivity(new Intent(context, C.class));
Typical usage of noHistory flag is with “Splash Screen” or Login Activities.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents