tags:

views:

89

answers:

1

Hi all,

I have a Android application that requires a splash screen. I have a simple activity which shows the splash screen and after a number of seconds, it starts the 'main' activity. Now, when a user presses the back button from that activity, the splash screen shows again. How can I prevent this? I tried keeping a boolean shownSplash and this partially works, but when the app is running and the user wants to open it from the app-launcher, the app exits (since splash calls finish() when splashShown is true). Any ideas?

Thanks, Erik

+6  A: 

Set android:noHistory="true" to the activity entry at the AndroidManifest.xml. That will prevent the activity from being saved on the stack.

Konstantin Burov
Wow, perfect! Thanks a lot.
Erik