IntentFilter
public
class
IntentFilter
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.content.IntentFilter |
Structured description of Intent values to be matched. An IntentFilter can match against actions, categories, and data (either via its type, scheme, and/or path) in an Intent. It also includes a "priority" value which is used to order multiple matching filters.
IntentFilter objects are often created in XML as part of a package's
AndroidManifest.xml file,
using intent-filter
tags.
There are three Intent characteristics you can filter on: the
action, data, and categories. For each of these
characteristics you can provide
multiple possible matching values (via addAction(String),
addDataType(String), addDataScheme(String), addDataSchemeSpecificPart(String, int),
addDataAuthority(String, String), addDataPath(String, int), and addCategory(String), respectively).
For actions, if no data characteristics are specified, then the filter will
only match intents that contain no data.
The data characteristic is itself divided into three attributes: type, scheme, authority, and path. Any that are specified must match the contents of the Intent. If you specify a scheme but no type, only Intent that does not have a type (such as mailto:) will match; a content: URI will never match because they always have a MIME type that is supplied by their content provider. Specifying a type with no scheme has somewhat special meaning: it will match either an Intent with no URI field, or an Intent with a content: or file: URI. If you specify neither, then only an Intent with no data or type will match. To specify an authority, you must also specify one or more schemes that it is associated with. To specify a path, you also must specify both one or more authorities and one or more schemes it is associated with.
Developer Guides
For information about how to create and resolve intents, read the Intents and Intent Filters developer guide.