Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid splash screen activity when pressing Back button

In my application, I have two activities. First is a splash screen, which simply shows the application name and few other info.

Upon clicking on the splash screen activity, I'm loading the main activity. My app works fine, but I'm facing a small issue. If I press back button from my main activity, control is going to splash screen activity. But I don't want to show the splash screen activity again, I want to avoid splash screen activity when pressing Back button.

Is it possible? If so how?

like image 566
user3162478 Avatar asked Sep 09 '25 16:09

user3162478


1 Answers

In your AndroidManifest.xml file, add android:noHistory="true" attribute in your splash screen <activity>.

like image 133
Gokul Nath KP Avatar answered Sep 12 '25 06:09

Gokul Nath KP