Flag of intent

Source: Internet
Author: User

The functions of various flags are collected and sorted, and only new flags are used for Supplement. Therefore, the list here is incomplete and can be updated at any time.
First, the flag usage:

1234
Intent it = new intent (); it. setclass (setting. This, Main. Class );// Jump from setting to mainIt. addflags (intent. flag_activity_clear_top );// Add the flagStartactivity (it );

According to the above example:
Without flag: If there is no flag, the above Code is to start the main, whether or not the main has been started, so the top-down order in the stack is main, setting, Main. There are two main
Flag_activity_clear_top: clears all the activities on the main (including setting, so you do not need to call the setting finish method here). If the main has been started and restarted, the stack goes from top to bottom: Main
Flag_activity_reorder_to_front: if the main has been started, the main will not be restarted. Instead, the main that is not displayed in the background will be taken to the very front, and the top-down sequence in the stack will be: Main, setting
Flag_activity_no_history: After you start main, if you switch to another activity (including pressing the return key and startactivity method), main will automatically call the finish method and will not stay in the stack.
Flag_activity_exclude_from_recents: After being started, it will not appear in the recent Startup Program that jumps out of the long-pressed home.

In addition, you can add multiple flags to addflags, and set multiple flags through |.

From: http://www.pocketdigi.com/20110406/232.html

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.