Meaning of the Onstartcommand method parameter in the Service

Source: Internet
Author: User

In the service Onstartcommand (Intent Intent, int flags, int startid) The meanings of these three parameters are, Intent is StartService (Intent Intent) The intent;flags on behalf of flags indicates how the service is started:

Additional data about this start request. Currently either 0, Start_flag_redelivery, or start_flag_retry.

Start_flag_redelivery: If you implement Onstartcommand () to schedule asynchronous work or work in another thread, you may need to use Start_flag_redelivery to have the system resend a intent. This way, if your service is killed when it is processed, intent will not be lost.

Start_flag_retry: Indicates that the service was set to Start_sticky before this token is passed in. The value of Startid is the number of the activity or other entity that is requested for this service, unique.


Meaning of the Onstartcommand method parameter in the Service

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.