"Learning Notes" Activity startup mode in Android

Source: Internet
Author: User

Learn two concepts first: task stack ID, activity instance ID

Setting the startup mode in Manifests->activitymanifest.xml

<activity android:name= ". Mainactivity "android:launchmode=" standard ">


Standard mode

Every time you start your own activity will start, the task stack ID one, the activity instance ID is different each time


Second, Singletop

When the activity to be started is at the top of the stack, launching itself will only create an activity instance.

A new activity instance is created when the activity to be started is not at the top of the stack


Third, Singletask

For example, starting from the Mainactivity bactivity, and then start Mainactivity, will bactivity pop-up, directly back to just the mainactivity, and then return to the point of direct exit


Iv. singleinstance

Only one instance of activity will be placed in a task stack.

"Learning Notes" Activity startup mode in Android

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.