Android Startup Mode and androidlaunchmode

Source: Internet
Author: User

Android Startup Mode and androidlaunchmode

In Android, there are four Activity startup modes, which are described as follows:

Configure android: launchMode attributes in AndroidManifest. xml

 

1. standard:

Default start mode.

An instance is created each time, and can be used in each task stack.

 

2. singleTop:

The system will process the jump behavior in singleTop startup mode. When the jump is made, the system will first look for the stack structure to see if there is an Activity instance located at the top of the stack. If there is one, it will not generate a new one, but it will be used directly. If the system finds that there is an Activity instance, but it is not located at the top of the stack, regenerate an instance.

The singleTop startup mode is like this. If the corresponding Activity instance is found to be at the top of the stack, you can create only one instance after creation ). otherwise, a new instance is created without being at the top of the stack.

 

3. singleTask:

If a corresponding Acitivty instance is foundAboveAll Activity instances exit the stack, so that the acitiworkflow Instance becomes the top object of the stack and is displayed on the screen.

 

4. singleInstance:

The startup mode is special this time, because it will enable a new stack structure, place the Activity in the new stack structure, and ensure that no other Activity instances will enter.

Only one independent task stack exists, and only one task stack is included.

 

 

1. Is the text expression abstract?

  SingleTop

      

 

SingleTask

  

 

SingleInstance

  

 

2. Where can these startup modes be used?

 

 

 

 

3. What is the secret behind the startup mode?

 

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.