Android Launchmode (four startup modes) application scenarios and examples

Source: Internet
Author: User

mode Introduction [1] Standard mode     This is the default mode, the activity instance is created each time the activity is activated and placed in the task stack. [2] singletop mode     If there is an instance of the activity at the top of the stack, the instance is reused (the onnewintent () of the instance is invoked), otherwise a new instance is created and placed on top of the stack. Even if an instance of the activity already exists in the stack, a new instance will be created as long as it is not on top of the stack. [3] Singletask mode     If there is already an instance of the activity in the stack, the instance is reused (the onnewintent () of the instance is invoked). When reused, the instance is returned to the top of the stack, so instances above it will be moved out of the stack. If the instance does not exist in the stack, a new instance is created to be put into the stack. [4] singleinstance mode     creates an instance of the activity in a new stack and lets multiple apps share the activity instance in that stack. Once the activity instance of the pattern already exists in a stack, any application that activates the activity will reuse the instance in that stack (the onnewintent () of the instance is invoked). The effect is that multiple apps share an app, regardless of who activates the Activity into the same app. Sets the location of the startup mode in the Androidmanifest.xml file for the Activity element's Android:launchmode property. 

Application Scenario http: // www.intridea.com/blog/2011/6/16/android-understanding-activity-launchmodehttp://  Stackoverflow.com/questions/2626218/examples-for-android-launch-modes, B (singleinstance) C, after completely exiting, start here, first Open is B. Google Maps is used in an app, and when you exit the app, you get to Google Maps or just the interface

Android Launchmode (four startup modes) application scenarios and examples

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.