Android Install app After click Open to bring problems

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.