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” />