Pendingintent--------Flags

Source: Internet
Author: User

public static Pendingintent getactivity (context context, int requestcode,intent Intent, int flags); So far only Flag_one_ SHOT, Flag_no_create, flag_cancel_current, flag_update_current these four flags.

1. The pendingintent obtained using Flag_one_shot can only be used once, even if re-acquired using the above three methods, then Pendingintent will fail.

2. Using the pendingintent obtained by flag_no_creat, returns a null value if the described intent does not exist.

3. If the described pendingintent already exists, the current will be canceled before the new intent is generated. You can use it to retrieve new intent if you just want to change the extra data in the intent. By canceling the previous intent, you can make sure that only the most recent entity is available to launch it. If this guarantee is not a problem, consider flag_update_current.

4. The most frequently used is flag_update_current, because the description of the intent is updated when you need to use this flag to update your description, otherwise the component will be the next event or time arrives extras is always the first intent extras.

Pendingintent--------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.