[Android Development Article] [Application Components] Intent and Intent Filters

Source: Internet
Author: User

Https://developer.android.com/guide/components/intents-filters.html

Intentis a messaging object that you can use to request operations from other application components. Although Intent can facilitate communication between components in a number of ways, its basic use cases include the following three:

  • Start Activity:

    ActivityRepresents a screen in an app. Intent startActivity() You can start a new instance by passing it to Activity . Intentdescribes the Activity to be started and carries any necessary data.

    Call if you want the results to be received after the Activity completes startActivityForResult() . In the activity onActivityResult() callback, your activity receives the result as a separate Intent object. For more information, please see the Activity Guide.

  • Start the service :

    Serviceis a component that performs operations in the background without using the user interface. By Intent passing it on startService() , you can start the service to perform a one-time operation (for example, download a file). Intentdescribes the service to be started and carries any necessary data.

    If the service is intended to use a client-server interface, by passing it on Intent bindService() , you can bind to the service from other components. For more information, please refer to the service guide.

  • Delivery Broadcast :

    Broadcasts are messages that can be received by any application. Various broadcasts are delivered for system events, such as when the system starts or when the device starts charging. Intentyou can pass the sendBroadcast() broadcast to another app by passing it to, sendOrderedBroadcast() or sendStickyBroadcast() .

[Android Development Article] [Application Components] Intent and Intent Filters

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.