Android activity launches 4 ways to record and open other apps ' activity pits

Source: Internet
Author: User

The four ways Android boots are standard,singletop,singletask,singleinstence, respectively.

Standard is the most common way to start an activity and is the default way to start. When you start an activity, he goes to the top of the stack at the back of the stack. The system does not control whether the stack has the same activity, in the same way as after-in first-out.

Singletop mode is when the activity starts, the system first determines whether the top of the stack has the same activity, if there is no new activity, otherwise it will not create a new activity. But to use him directly.

Singletask mode at the start of the activity, the system first determine whether there is an instance of the activity in the stack, if there is no new instance, if there is a stack of existing activities above the stack.

The singleinstance mode creates a new stack when it is started, and is the same instance when other programs access the activity to initiate the activity, and all applications access the same instance.

In the experimental application B to access activity A with SingleInstance startup mode, you need to be aware that you want to add the Androidmanifest.xml in the A application.

<activity    android:name= "com.example.testandroid.BActivity"    android:exported= "true" >
</activity>

Android:exported= "True" This is a statement that the activity can be opened by other apps

Reference: http://www.cnblogs.com/lwbqqyumidi/p/3793440.html

Android activity launches 4 ways to record and open other apps ' activity pits

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.