Removing an activity from the history stack
You can achieve this by setting the android:noHistory
attribute to "true"
in the relevant <activity>
entries in your AndroidManifest.xml
file. For example:
<activity android:name=".AnyActivity" android:noHistory="true" />
You can use forwarding to remove the previous activity from the activity stack while launching the next one. There's an example of this in the APIDemos, but basically all you're doing is calling finish()
immediately after calling startActivity()
.