Today the Crazy Android Intent (intentions) this chapter looked. Summed up some of the points of knowledge

Source: Internet
Author: User

Intent---to express his intentions

can be activated via Intent (activity, service, Broadcastreceiver)
Intent is an important medium for communication between program components

A intent object can contain only one action

Intent properties: Component, Action, Category, Data, Type, Extra, Flag
|---Component
Used to specify the target component that needs to be started
Component property needs to accept a ComponentName object
ComponentName: You need to specify the package name and class name
The component property is specified explicitly which component to start (explicit intent)
|---Flag
For carrying data that needs to be exchanged

|---Action represents the abstract "action" that intent is going to complete.

|---Category to add additional category information to the action

|---data that is used to provide an action to the Action property to accept a (Uri) object
|
|----URI object is represented by a string
Content://com.android.contacts/contacts/1
Uri string Format specification: Scheme://host:port/path scheme ==> content host===>com.android.contacts port (omitted) PATH===>CONTAC Ts/1

|---Type the object MIME type used to specify the URI can be customized in MIME type format: (ABC/XYZ)

|---Extra Extra property is used for data exchange between multiple actions

| The---Flag flag property is used to add some additional control flags to the intent
|
|-----commonly used flag flags
|
|----Flag_activity_brought_to_front (activity will be activated directly from the activity stack the next time it is started by Flag_activity_brought_to_front. Into the top of the stack)


<intent-filter> contained sub-elements
1.<action>
2.<category>
3.<data>

Today the Crazy Android Intent (intentions) this chapter looked. Summed up some of the points of knowledge

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.