简体   繁体   中英

Activity: from home screen launch or back from the stack

How can I determine if my main/launcher activity has been invoked from the home screen or by backing up the activity stack?

I display a splash screen and would only like to show it when a user has arrived there from the home screen.

Make the splash screen be a separate activity. Have it be the one you have in the LAUNCHER category. And, when it advances to your next activity, have it finish() so it is no longer on the stack. Then, the only way the splash screen should be seen is if your program in not already running and Android starts from scratch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM