I want to erase the activity from the history stack

Asked 2 years ago, Updated 2 years ago, 127 views

There are three activities in my app.

When the user goes from Activity 2 to Activity 3, can we erase Activity 1 and Activity 2 from the history stack? When the user presses the back button while playing the game, I want to go to the home screen rather than going back to Activity 2.

android android-activity activity-lifecycle

2022-09-21 23:01

1 Answers

You can go to the Android manifest file and give a true value to the android:noHistory property in **. **android:noHistory="true"Like this.


2022-09-21 23:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.