Android's intent-Filter matching rules

1.Intent is one of the four components of the Android, which not only refers to the current action components that you want to perform, you can also transfer data between different components.
2.Intent Intent includes a display and implicit Intent
3.Intent the Filter: Intent attribute is actually a set of constraints, including restrictions Intent Action objects, data, category attributes such as a description of the capabilities of each Intent Filter assembly , i.e. able to accept a group of Intent.
4.Intent associated attributes match the Filter are Intent action (behavior), category (category), data (data), Extras (additional information), component (target component)

The following detailed accept the intent filters (Intent Filter) matching rules:

  • For display Intent, an important component name only, all other aspects or attributes will be ignored
  • For implicit Intent, with a matching action, category, data

data: Only data when the content of the label specified in the Data and Intent to carry exactly the same, to be able to respond to the current activities of Intent
if the data labels do not specify the content, it will only be matched not carry Data of Intent
category: only category labels when the content specified in a particular category consistent with the intent to carry, to be able to respond to the current activities of intent
if the category does not specify the content, it will only match of intent does not carry category
(Note: the intent is not specified category, as android .intent.category.DEFAULT)
action: If the action tag does not specify anything, and it carries Intent matches any action
if the action specified in the tag of one or more contents, and the same one as long as an action carried Intent You will be able to match.

Published 19 original articles · won praise 2 · Views 419

Guess you like

Origin blog.csdn.net/TheWindOfSon/article/details/103834033