Today, when the app is installed, the interface will display two buttons, a complete key, an open key, and open the app externally after clicking the Open key. At this point, we click the Home button, the program will be in the background. Then click on the app icon on the desktop and the app will restart itself! Instead of the original interface! If your app is not sensitive to multiple launches, this is fine, but if your app is sensitive to multiple launches, make a choice. Find out a good way to read the relevant information.
First, when starting the first activity, determine whether the startup mode is started by clicking the Open key.
Second, if you need to refer the previous application to the foreground, you can immediately end the current activity, at which point you can let the previous
The minimized Activity is displayed.
Finally, the first open Activity code.
@Override protected void onCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); if (Getintent (). GetFlags () & intent.flag_activity_brought_to_front)! = 0) { finish ();// End the new activity return if you want to restore the previous interface ; } Setcontentview (R.layout.main); }
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android Install app After click Open to bring problems