Android:intent Flags

Source: Internet
Author: User

Reprinted from: http://www.cnblogs.com/mybkn/archive/2012/05/26/2519644.html

The relationship between activity and task (stack)
A task is like a container, and activity is quite the thing that fills the container, the first thing (activity) is at the bottom, and the last thing added (activity) is at the lowest end. The activity is taken from the top of the task, that is, the first thing to be taken out is the last addition (activity), one analogy, and finally the activity that was added for the first time, and the order of activity in the task can be controlled, The intent Flag is used when the activity jumps.

Second, the interface jump and service start will be used to intent, now introduce intent flag is about the activity of the jump
Intent Intent = new Intent (this,xxx.class);
If the activity is present in the task and gets to the top, no new activity is started
Intent.addflags (Intent.flag_activity_brought_to_front);
If activity is present in a task, all activity above activity is ended
Intent.addflags (Intent.flag_activity_clear_top);
Default jump type, putting activity into a new task
Intent.addflags (Intent.flag_activity_new_task);
If the activity is already running to a task, jumping again will not run the activity
Intent.addflags (Intent.flag_activity_single_top);

Android:intent Flags

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.