Use android:noHistory="true"
Whether an action should be excluded from the action stack and finished (its finish () method is called) when the user moves away from him and he is no longer visible on the screen is โtrueโ if it should be completed and โfalseโ if not. The default value is incorrect. "True" means that the activity will not leave a historical mark. This will not remain in the action stack for the task, so the user will not be able to return to it.
source share