# IntentFilter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/content/IntentFilter#nestedclasses)\|[Constants](https://developer.android.com/reference/android/content/IntentFilter#constants)\|[Inherited Constants](https://developer.android.com/reference/android/content/IntentFilter#inhconstants)\|[Fields](https://developer.android.com/reference/android/content/IntentFilter#lfields)\|[Ctors](https://developer.android.com/reference/android/content/IntentFilter#pubctors)\|[Methods](https://developer.android.com/reference/android/content/IntentFilter#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/content/IntentFilter#inhmethods)  

# IntentFilter

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/content/IntentFilter "View this page in Kotlin")\|Java

`
public


class
IntentFilter
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable)`


`

|---|------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.IntentFilter |

<br />

*** ** * ** ***

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](https://developer.android.com/reference/android/R.styleable#AndroidManifest)file, using[intent-filter](https://developer.android.com/reference/android/R.styleable#AndroidManifestIntentFilter)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)](https://developer.android.com/reference/android/content/IntentFilter#addAction(java.lang.String)),[addDataType(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataType(java.lang.String)),[addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String)),[addDataSchemeSpecificPart(String, int)](https://developer.android.com/reference/android/content/IntentFilter#addDataSchemeSpecificPart(java.lang.String,%20int)),[addDataAuthority(String, String)](https://developer.android.com/reference/android/content/IntentFilter#addDataAuthority(java.lang.String,%20java.lang.String)),[addDataPath(String, int)](https://developer.android.com/reference/android/content/IntentFilter#addDataPath(java.lang.String,%20int)), and[addCategory(String)](https://developer.android.com/reference/android/content/IntentFilter#addCategory(java.lang.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](https://developer.android.com/guide/topics/intents/intents-filters)developer guide.

### Filter Rules

A match is based on the following rules. Note that for an IntentFilter to match an Intent, three conditions must hold: the**action** and**category** must match, and the data (both the**data type** and**data scheme+authority+path** if specified) must match (see[match(android.content.ContentResolver, android.content.Intent, boolean, java.lang.String)](https://developer.android.com/reference/android/content/IntentFilter#match(android.content.ContentResolver,%20android.content.Intent,%20boolean,%20java.lang.String))for more details on how the data fields match).

**Action**matches if any of the given values match the Intent action; if the filter specifies no actions, then it will only match Intents that do not contain an action.

**Data Type** matches if any of the given values match the Intent type. The Intent type is determined by calling[Intent.resolveType](https://developer.android.com/reference/android/content/Intent#resolveType(android.content.ContentResolver)). A wildcard can be used for the MIME sub-type, in both the Intent and IntentFilter, so that the type "audio/\*" will match "audio/mpeg", "audio/aiff", "audio/\*", etc.*Note that MIME type matching here is**case sensitive**, unlike formal RFC MIME types!*You should thus always use lower case letters for your MIME types.

**Data Scheme** matches if any of the given values match the Intent data's scheme. The Intent scheme is determined by calling[Intent.getData](https://developer.android.com/reference/android/content/Intent#getData())and[Uri.getScheme()](https://developer.android.com/reference/android/net/Uri#getScheme())on that URI.*Note that scheme matching here is**case sensitive**, unlike formal RFC schemes!*You should thus always use lower case letters for your schemes.

**Data Scheme Specific Part** matches if any of the given values match the Intent's data scheme specific part*and* one of the data schemes in the filter has matched the Intent,*or* no scheme specific parts were supplied in the filter. The Intent scheme specific part is determined by calling[Intent.getData](https://developer.android.com/reference/android/content/Intent#getData())and[Uri.getSchemeSpecificPart()](https://developer.android.com/reference/android/net/Uri#getSchemeSpecificPart())on that URI.*Note that scheme specific part matching is**case sensitive**.*

**Data Authority** matches if any of the given values match the Intent's data authority*and* one of the data schemes in the filter has matched the Intent,*or* no authorities were supplied in the filter. The Intent authority is determined by calling[Intent.getData](https://developer.android.com/reference/android/content/Intent#getData())and[Uri.getAuthority()](https://developer.android.com/reference/android/net/Uri#getAuthority())on that URI.*Note that authority matching here is**case sensitive**, unlike formal RFC host names!*You should thus always use lower case letters for your authority.

**Data Path** matches if any of the given values match the Intent's data path*and* both a scheme and authority in the filter has matched against the Intent,*or* no paths were supplied in the filter. The Intent authority is determined by calling[Intent.getData](https://developer.android.com/reference/android/content/Intent#getData())and[Uri.getPath()](https://developer.android.com/reference/android/net/Uri#getPath())on that URI.

**Categories** match if*all*of the categories in the Intent match categories given in the filter. Extra categories in the filter that are not in the Intent will not cause the match to fail. Note that unlike the action, an IntentFilter with no categories will only match an Intent that does not have any categories.

## Summary

|                                                                                                                                                        ### Nested classes                                                                                                                                                         ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [IntentFilter.AuthorityEntry](https://developer.android.com/reference/android/content/IntentFilter.AuthorityEntry) This is an entry for a single authority in the Iterator returned by[IntentFilter.authoritiesIterator()](https://developer.android.com/reference/android/content/IntentFilter#authoritiesIterator()). |
| ` class` | [IntentFilter.MalformedMimeTypeException](https://developer.android.com/reference/android/content/IntentFilter.MalformedMimeTypeException) This exception is thrown when a given MIME type does not have a valid syntax.                                                                                                |

|                                                                                                                                                                             ### Constants                                                                                                                                                                             ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [MATCH_ADJUSTMENT_MASK](https://developer.android.com/reference/android/content/IntentFilter#MATCH_ADJUSTMENT_MASK) The part of a match constant that applies a quality adjustment to the basic category of match.                                                                                                                                             |
| `int` | [MATCH_ADJUSTMENT_NORMAL](https://developer.android.com/reference/android/content/IntentFilter#MATCH_ADJUSTMENT_NORMAL) Quality adjustment applied to the category of match that signifies the default, base value; higher numbers improve the quality while lower numbers reduce it.                                                                          |
| `int` | [MATCH_CATEGORY_EMPTY](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_EMPTY) The filter matched an intent that had no data specified.                                                                                                                                                                                     |
| `int` | [MATCH_CATEGORY_HOST](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_HOST) The filter matched an intent with the same data URI scheme and authority host.                                                                                                                                                                 |
| `int` | [MATCH_CATEGORY_MASK](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_MASK) The part of a match constant that describes the category of match that occurred.                                                                                                                                                               |
| `int` | [MATCH_CATEGORY_PATH](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_PATH) The filter matched an intent with the same data URI scheme, authority, and path.                                                                                                                                                               |
| `int` | [MATCH_CATEGORY_PORT](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_PORT) The filter matched an intent with the same data URI scheme and authority host and port.                                                                                                                                                        |
| `int` | [MATCH_CATEGORY_SCHEME](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_SCHEME) The filter matched an intent with the same data URI scheme.                                                                                                                                                                                |
| `int` | [MATCH_CATEGORY_SCHEME_SPECIFIC_PART](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_SCHEME_SPECIFIC_PART) The filter matched an intent with the same data URI scheme and scheme specific part.                                                                                                                           |
| `int` | [MATCH_CATEGORY_TYPE](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_TYPE) The filter matched an intent with the same data MIME type.                                                                                                                                                                                     |
| `int` | [NO_MATCH_ACTION](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_ACTION) The filter didn't match due to different actions.                                                                                                                                                                                                      |
| `int` | [NO_MATCH_CATEGORY](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_CATEGORY) The filter didn't match because it required one or more categories that were not in the Intent.                                                                                                                                                    |
| `int` | [NO_MATCH_DATA](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_DATA) The filter didn't match due to different data URIs.                                                                                                                                                                                                        |
| `int` | [NO_MATCH_TYPE](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_TYPE) The filter didn't match due to different MIME types.                                                                                                                                                                                                       |
| `int` | [SYSTEM_HIGH_PRIORITY](https://developer.android.com/reference/android/content/IntentFilter#SYSTEM_HIGH_PRIORITY) The filter[setPriority(int)](https://developer.android.com/reference/android/content/IntentFilter#setPriority(int))value at which system high-priority receivers are placed; that is, receivers that should execute before application code. |
| `int` | [SYSTEM_LOW_PRIORITY](https://developer.android.com/reference/android/content/IntentFilter#SYSTEM_LOW_PRIORITY) The filter[setPriority(int)](https://developer.android.com/reference/android/content/IntentFilter#setPriority(int))value at which system low-priority receivers are placed; that is, receivers that should execute after application code.     |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable) |-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) Descriptor bit used with[describeContents()](https://developer.android.com/reference/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor.                                                                                                                                            | | `int` | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE) Flag for use with[writeToParcel(Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

|                                                                                                                                            ### Fields                                                                                                                                             ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| ` public static final `[Creator](https://developer.android.com/reference/android/os/Parcelable.Creator)`<`[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter)`>` | [CREATOR](https://developer.android.com/reference/android/content/IntentFilter#CREATOR) <br /> |

|                                                                                                                                                                          ### Public constructors                                                                                                                                                                          ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter#IntentFilter())`() ` New empty IntentFilter.                                                                                                                                                                                                                                    |
| ` `[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter#IntentFilter(android.content.IntentFilter))`(`[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter)` o) ` New IntentFilter containing a copy of an existing filter.                                                                              |
| ` `[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter#IntentFilter(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` action) ` New IntentFilter that matches a single action with no data.                                                                                                     |
| ` `[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter#IntentFilter(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` action, `[String](https://developer.android.com/reference/java/lang/String)` dataType) ` New IntentFilter that matches a single action and data type. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` final `[Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[String](https://developer.android.com/reference/java/lang/String)`>`                                                 | ` `[actionsIterator](https://developer.android.com/reference/android/content/IntentFilter#actionsIterator())`() ` Return an iterator over the filter's actions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` final void`                                                                                                                                                                                           | ` `[addAction](https://developer.android.com/reference/android/content/IntentFilter#addAction(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` action) ` Add a new Intent action to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final void`                                                                                                                                                                                           | ` `[addCategory](https://developer.android.com/reference/android/content/IntentFilter#addCategory(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` category) ` Add a new Intent category to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` final void`                                                                                                                                                                                           | ` `[addDataAuthority](https://developer.android.com/reference/android/content/IntentFilter#addDataAuthority(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` host, `[String](https://developer.android.com/reference/java/lang/String)` port) ` Add a new Intent data authority to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final void`                                                                                                                                                                                           | ` `[addDataPath](https://developer.android.com/reference/android/content/IntentFilter#addDataPath(java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` path, int type) ` Add a new Intent data path to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` final void`                                                                                                                                                                                           | ` `[addDataScheme](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` scheme) ` Add a new Intent data scheme to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` final void`                                                                                                                                                                                           | ` `[addDataSchemeSpecificPart](https://developer.android.com/reference/android/content/IntentFilter#addDataSchemeSpecificPart(java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` ssp, int type) ` Add a new Intent data "scheme specific part" to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final void`                                                                                                                                                                                           | ` `[addDataType](https://developer.android.com/reference/android/content/IntentFilter#addDataType(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` type) ` Add a new Intent data type to match against.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` final void`                                                                                                                                                                                           | ` `[addUriRelativeFilterGroup](https://developer.android.com/reference/android/content/IntentFilter#addUriRelativeFilterGroup(android.content.UriRelativeFilterGroup))`(`[UriRelativeFilterGroup](https://developer.android.com/reference/android/content/UriRelativeFilterGroup)` group) ` Add a new URI relative filter group to match against the Intent data.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` `[Predicate](https://developer.android.com/reference/java/util/function/Predicate)`<`[Intent](https://developer.android.com/reference/android/content/Intent)`>`                                      | ` `[asPredicate](https://developer.android.com/reference/android/content/IntentFilter#asPredicate())`() ` Return a[Predicate](https://developer.android.com/reference/java/util/function/Predicate)which tests whether this filter matches the given<var translate="no">intent</var>.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` `[Predicate](https://developer.android.com/reference/java/util/function/Predicate)`<`[Intent](https://developer.android.com/reference/android/content/Intent)`>`                                      | ` `[asPredicateWithTypeResolution](https://developer.android.com/reference/android/content/IntentFilter#asPredicateWithTypeResolution(android.content.ContentResolver))`(`[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)` resolver) ` Return a[Predicate](https://developer.android.com/reference/java/util/function/Predicate)which tests whether this filter matches the given<var translate="no">intent</var>.                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[IntentFilter.AuthorityEntry](https://developer.android.com/reference/android/content/IntentFilter.AuthorityEntry)`>` | ` `[authoritiesIterator](https://developer.android.com/reference/android/content/IntentFilter#authoritiesIterator())`() ` Return an iterator over the filter's data authorities.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` final `[Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[String](https://developer.android.com/reference/java/lang/String)`>`                                                 | ` `[categoriesIterator](https://developer.android.com/reference/android/content/IntentFilter#categoriesIterator())`() ` Return an iterator over the filter's categories.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` final void`                                                                                                                                                                                           | ` `[clearUriRelativeFilterGroups](https://developer.android.com/reference/android/content/IntentFilter#clearUriRelativeFilterGroups())`() ` Removes all existing URI relative filter groups in the intent filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` final int`                                                                                                                                                                                            | ` `[countActions](https://developer.android.com/reference/android/content/IntentFilter#countActions())`() ` Return the number of actions in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` final int`                                                                                                                                                                                            | ` `[countCategories](https://developer.android.com/reference/android/content/IntentFilter#countCategories())`() ` Return the number of categories in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` final int`                                                                                                                                                                                            | ` `[countDataAuthorities](https://developer.android.com/reference/android/content/IntentFilter#countDataAuthorities())`() ` Return the number of data authorities in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` final int`                                                                                                                                                                                            | ` `[countDataPaths](https://developer.android.com/reference/android/content/IntentFilter#countDataPaths())`() ` Return the number of data paths in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` final int`                                                                                                                                                                                            | ` `[countDataSchemeSpecificParts](https://developer.android.com/reference/android/content/IntentFilter#countDataSchemeSpecificParts())`() ` Return the number of data scheme specific parts in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final int`                                                                                                                                                                                            | ` `[countDataSchemes](https://developer.android.com/reference/android/content/IntentFilter#countDataSchemes())`() ` Return the number of data schemes in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` final int`                                                                                                                                                                                            | ` `[countDataTypes](https://developer.android.com/reference/android/content/IntentFilter#countDataTypes())`() ` Return the number of data types in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` final int`                                                                                                                                                                                            | ` `[countUriRelativeFilterGroups](https://developer.android.com/reference/android/content/IntentFilter#countUriRelativeFilterGroups())`() ` Return the number of URI relative filter groups in the intent filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` static `[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter)                                                                                                          | ` `[create](https://developer.android.com/reference/android/content/IntentFilter#create(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` action, `[String](https://developer.android.com/reference/java/lang/String)` dataType) ` Create a new IntentFilter instance with a specified action and MIME type, where you know the MIME type is correctly formatted.                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final int`                                                                                                                                                                                            | ` `[describeContents](https://developer.android.com/reference/android/content/IntentFilter#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` void`                                                                                                                                                                                                 | ` `[dump](https://developer.android.com/reference/android/content/IntentFilter#dump(android.util.Printer,%20java.lang.String))`(`[Printer](https://developer.android.com/reference/android/util/Printer)` du, `[String](https://developer.android.com/reference/java/lang/String)` prefix) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` final `[String](https://developer.android.com/reference/java/lang/String)                                                                                                                             | ` `[getAction](https://developer.android.com/reference/android/content/IntentFilter#getAction(int))`(int index) ` Return an action in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` final `[String](https://developer.android.com/reference/java/lang/String)                                                                                                                             | ` `[getCategory](https://developer.android.com/reference/android/content/IntentFilter#getCategory(int))`(int index) ` Return a category in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` final `[IntentFilter.AuthorityEntry](https://developer.android.com/reference/android/content/IntentFilter.AuthorityEntry)                                                                             | ` `[getDataAuthority](https://developer.android.com/reference/android/content/IntentFilter#getDataAuthority(int))`(int index) ` Return a data authority in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` final `[PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher)                                                                                                            | ` `[getDataPath](https://developer.android.com/reference/android/content/IntentFilter#getDataPath(int))`(int index) ` Return a data path in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` final `[String](https://developer.android.com/reference/java/lang/String)                                                                                                                             | ` `[getDataScheme](https://developer.android.com/reference/android/content/IntentFilter#getDataScheme(int))`(int index) ` Return a data scheme in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher)                                                                                                            | ` `[getDataSchemeSpecificPart](https://developer.android.com/reference/android/content/IntentFilter#getDataSchemeSpecificPart(int))`(int index) ` Return a data scheme specific part in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` final `[String](https://developer.android.com/reference/java/lang/String)                                                                                                                             | ` `[getDataType](https://developer.android.com/reference/android/content/IntentFilter#getDataType(int))`(int index) ` Return a data type in the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` final int`                                                                                                                                                                                            | ` `[getPriority](https://developer.android.com/reference/android/content/IntentFilter#getPriority())`() ` Return the priority of this filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final `[UriRelativeFilterGroup](https://developer.android.com/reference/android/content/UriRelativeFilterGroup)                                                                                       | ` `[getUriRelativeFilterGroup](https://developer.android.com/reference/android/content/IntentFilter#getUriRelativeFilterGroup(int))`(int index) ` Return a URI relative filter group in the intent filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final boolean`                                                                                                                                                                                        | ` `[hasAction](https://developer.android.com/reference/android/content/IntentFilter#hasAction(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` action) ` Is the given action included in the filter? Note that if the filter does not include any actions, false will*always*be returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` final boolean`                                                                                                                                                                                        | ` `[hasCategory](https://developer.android.com/reference/android/content/IntentFilter#hasCategory(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` category) ` Is the given category included in the filter?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` final boolean`                                                                                                                                                                                        | ` `[hasDataAuthority](https://developer.android.com/reference/android/content/IntentFilter#hasDataAuthority(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` data) ` Is the given data authority included in the filter? Note that if the filter does not include any authorities, false will*always*be returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` final boolean`                                                                                                                                                                                        | ` `[hasDataPath](https://developer.android.com/reference/android/content/IntentFilter#hasDataPath(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` data) ` Is the given data path included in the filter? Note that if the filter does not include any paths, false will*always*be returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` final boolean`                                                                                                                                                                                        | ` `[hasDataScheme](https://developer.android.com/reference/android/content/IntentFilter#hasDataScheme(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` scheme) ` Is the given data scheme included in the filter? Note that if the filter does not include any scheme, false will*always*be returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` final boolean`                                                                                                                                                                                        | ` `[hasDataSchemeSpecificPart](https://developer.android.com/reference/android/content/IntentFilter#hasDataSchemeSpecificPart(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` data) ` Is the given data scheme specific part included in the filter? Note that if the filter does not include any scheme specific parts, false will*always*be returned.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` final boolean`                                                                                                                                                                                        | ` `[hasDataType](https://developer.android.com/reference/android/content/IntentFilter#hasDataType(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` type) ` Is the given data type included in the filter? Note that if the filter does not include any type, false will*always*be returned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` final int`                                                                                                                                                                                            | ` `[match](https://developer.android.com/reference/android/content/IntentFilter#match(java.lang.String,%20java.lang.String,%20java.lang.String,%20android.net.Uri,%20java.util.Set<java.lang.String>,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` action, `[String](https://developer.android.com/reference/java/lang/String)` type, `[String](https://developer.android.com/reference/java/lang/String)` scheme, `[Uri](https://developer.android.com/reference/android/net/Uri)` data, `[Set](https://developer.android.com/reference/java/util/Set)`<`[String](https://developer.android.com/reference/java/lang/String)`> categories, `[String](https://developer.android.com/reference/java/lang/String)` logTag) ` Test whether this filter matches the given intent data. |
| ` final int`                                                                                                                                                                                            | ` `[match](https://developer.android.com/reference/android/content/IntentFilter#match(android.content.ContentResolver,%20android.content.Intent,%20boolean,%20java.lang.String))`(`[ContentResolver](https://developer.android.com/reference/android/content/ContentResolver)` resolver, `[Intent](https://developer.android.com/reference/android/content/Intent)` intent, boolean resolve, `[String](https://developer.android.com/reference/java/lang/String)` logTag) ` Test whether this filter matches the given<var translate="no">intent</var>.                                                                                                                                                                                                                                                                         |
| ` final boolean`                                                                                                                                                                                        | ` `[matchAction](https://developer.android.com/reference/android/content/IntentFilter#matchAction(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` action) ` Match this filter against an Intent's action.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` final `[String](https://developer.android.com/reference/java/lang/String)                                                                                                                             | ` `[matchCategories](https://developer.android.com/reference/android/content/IntentFilter#matchCategories(java.util.Set<java.lang.String>))`(`[Set](https://developer.android.com/reference/java/util/Set)`<`[String](https://developer.android.com/reference/java/lang/String)`> categories) ` Match this filter against an Intent's categories.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` final int`                                                                                                                                                                                            | ` `[matchData](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri))`(`[String](https://developer.android.com/reference/java/lang/String)` type, `[String](https://developer.android.com/reference/java/lang/String)` scheme, `[Uri](https://developer.android.com/reference/android/net/Uri)` data) ` Match this filter against an Intent's data (type, scheme and path).                                                                                                                                                                                                                                                                                                                                                                   |
| ` final int`                                                                                                                                                                                            | ` `[matchDataAuthority](https://developer.android.com/reference/android/content/IntentFilter#matchDataAuthority(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` data) ` Match this intent filter against the given Intent data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` final `[Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher)`>`                                | ` `[pathsIterator](https://developer.android.com/reference/android/content/IntentFilter#pathsIterator())`() ` Return an iterator over the filter's data paths.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                                                                                                                 | ` `[readFromXml](https://developer.android.com/reference/android/content/IntentFilter#readFromXml(org.xmlpull.v1.XmlPullParser))`(`[XmlPullParser](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser)` parser) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` final `[Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher)`>`                                | ` `[schemeSpecificPartsIterator](https://developer.android.com/reference/android/content/IntentFilter#schemeSpecificPartsIterator())`() ` Return an iterator over the filter's data scheme specific parts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` final `[Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[String](https://developer.android.com/reference/java/lang/String)`>`                                                 | ` `[schemesIterator](https://developer.android.com/reference/android/content/IntentFilter#schemesIterator())`() ` Return an iterator over the filter's data schemes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` final void`                                                                                                                                                                                           | ` `[setPriority](https://developer.android.com/reference/android/content/IntentFilter#setPriority(int))`(int priority) ` Modify priority of this filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` final `[Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[String](https://developer.android.com/reference/java/lang/String)`>`                                                 | ` `[typesIterator](https://developer.android.com/reference/android/content/IntentFilter#typesIterator())`() ` Return an iterator over the filter's data types.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` final void`                                                                                                                                                                                           | ` `[writeToParcel](https://developer.android.com/reference/android/content/IntentFilter#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                                                                                                                 | ` `[writeToXml](https://developer.android.com/reference/android/content/IntentFilter#writeToXml(org.xmlpull.v1.XmlSerializer))`(`[XmlSerializer](https://developer.android.com/reference/org/xmlpull/v1/XmlSerializer)` serializer) ` Write the contents of the IntentFilter as an XML stream.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||
| From interface` `[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable)` ` |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`  | ` `[describeContents](https://developer.android.com/reference/android/os/Parcelable#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                    | | ` abstract void` | ` `[writeToParcel](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### MATCH_ADJUSTMENT_MASK

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_ADJUSTMENT_MASK
```

The part of a match constant that applies a quality adjustment to the basic category of match. The value[MATCH_ADJUSTMENT_NORMAL](https://developer.android.com/reference/android/content/IntentFilter#MATCH_ADJUSTMENT_NORMAL)is no adjustment; higher numbers than that improve the quality, while lower numbers reduce it.

<br />

Constant Value: 65535 (0x0000ffff)  

### MATCH_ADJUSTMENT_NORMAL

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_ADJUSTMENT_NORMAL
```

Quality adjustment applied to the category of match that signifies the default, base value; higher numbers improve the quality while lower numbers reduce it.

<br />

Constant Value: 32768 (0x00008000)  

### MATCH_CATEGORY_EMPTY

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_CATEGORY_EMPTY
```

The filter matched an intent that had no data specified.

<br />

Constant Value: 1048576 (0x00100000)  

### MATCH_CATEGORY_HOST

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_CATEGORY_HOST
```

The filter matched an intent with the same data URI scheme and authority host.

<br />

Constant Value: 3145728 (0x00300000)  

### MATCH_CATEGORY_MASK

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_CATEGORY_MASK
```

The part of a match constant that describes the category of match that occurred. May be either[MATCH_CATEGORY_EMPTY](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_EMPTY),[MATCH_CATEGORY_SCHEME](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_SCHEME),[MATCH_CATEGORY_SCHEME_SPECIFIC_PART](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_SCHEME_SPECIFIC_PART),[MATCH_CATEGORY_HOST](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_HOST),[MATCH_CATEGORY_PORT](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_PORT),[MATCH_CATEGORY_PATH](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_PATH), or[MATCH_CATEGORY_TYPE](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_TYPE). Higher values indicate a better match.

<br />

Constant Value: 268369920 (0x0fff0000)  

### MATCH_CATEGORY_PATH

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_CATEGORY_PATH
```

The filter matched an intent with the same data URI scheme, authority, and path.

<br />

Constant Value: 5242880 (0x00500000)  

### MATCH_CATEGORY_PORT

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_CATEGORY_PORT
```

The filter matched an intent with the same data URI scheme and authority host and port.

<br />

Constant Value: 4194304 (0x00400000)  

### MATCH_CATEGORY_SCHEME

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_CATEGORY_SCHEME
```

The filter matched an intent with the same data URI scheme.

<br />

Constant Value: 2097152 (0x00200000)  

### MATCH_CATEGORY_SCHEME_SPECIFIC_PART

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_CATEGORY_SCHEME_SPECIFIC_PART
```

The filter matched an intent with the same data URI scheme and scheme specific part.

<br />

Constant Value: 5767168 (0x00580000)  

### MATCH_CATEGORY_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int MATCH_CATEGORY_TYPE
```

The filter matched an intent with the same data MIME type.

<br />

Constant Value: 6291456 (0x00600000)  

### NO_MATCH_ACTION

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NO_MATCH_ACTION
```

The filter didn't match due to different actions.

<br />

Constant Value: -3 (0xfffffffd)  

### NO_MATCH_CATEGORY

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NO_MATCH_CATEGORY
```

The filter didn't match because it required one or more categories that were not in the Intent.

<br />

Constant Value: -4 (0xfffffffc)  

### NO_MATCH_DATA

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NO_MATCH_DATA
```

The filter didn't match due to different data URIs.

<br />

Constant Value: -2 (0xfffffffe)  

### NO_MATCH_TYPE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int NO_MATCH_TYPE
```

The filter didn't match due to different MIME types.

<br />

Constant Value: -1 (0xffffffff)  

### SYSTEM_HIGH_PRIORITY

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int SYSTEM_HIGH_PRIORITY
```

The filter[setPriority(int)](https://developer.android.com/reference/android/content/IntentFilter#setPriority(int))value at which system high-priority receivers are placed; that is, receivers that should execute before application code. Applications should never use filters with this or higher priorities.

<br />

**See also:**

- [setPriority(int)](https://developer.android.com/reference/android/content/IntentFilter#setPriority(int))

Constant Value: 1000 (0x000003e8)  

### SYSTEM_LOW_PRIORITY

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int SYSTEM_LOW_PRIORITY
```

The filter[setPriority(int)](https://developer.android.com/reference/android/content/IntentFilter#setPriority(int))value at which system low-priority receivers are placed; that is, receivers that should execute after application code. Applications should never use filters with this or lower priorities.

<br />

**See also:**

- [setPriority(int)](https://developer.android.com/reference/android/content/IntentFilter#setPriority(int))

Constant Value: -1000 (0xfffffc18)

## Fields

### CREATOR

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final Creator<IntentFilter> CREATOR
```

<br />

<br />

## Public constructors

### IntentFilter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public IntentFilter ()
```

New empty IntentFilter.

<br />

### IntentFilter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public IntentFilter (IntentFilter o)
```

New IntentFilter containing a copy of an existing filter.

<br />

|                        Parameters                        ||
|-----|-----------------------------------------------------|
| `o` | `IntentFilter`: The original filter to copy. <br /> |

### IntentFilter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public IntentFilter (String action)
```

New IntentFilter that matches a single action with no data. If no data characteristics are subsequently specified, then the filter will only match intents that contain no data.

<br />

|                                 Parameters                                  ||
|----------|-------------------------------------------------------------------|
| `action` | `String`: The action to match, such as Intent.ACTION_MAIN. <br /> |

### IntentFilter

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public IntentFilter (String action, 
                String dataType)
```

New IntentFilter that matches a single action and data type.

*Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types. As a result, you should always write your MIME types with lower case letters, and any MIME types you receive from outside of Android should be converted to lower case before supplying them here.*

Throws[MalformedMimeTypeException](https://developer.android.com/reference/android/content/IntentFilter.MalformedMimeTypeException)if the given MIME type is not syntactically correct.

<br />

|                                        Parameters                                        ||
|------------|------------------------------------------------------------------------------|
| `action`   | `String`: The action to match, such as Intent.ACTION_VIEW. <br />            |
| `dataType` | `String`: The type to match, such as "vnd.android.cursor.dir/person". <br /> |

|                                                                    Throws                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------|---|
| [IntentFilter.MalformedMimeTypeException](https://developer.android.com/reference/android/content/IntentFilter.MalformedMimeTypeException) |   |

## Public methods

### actionsIterator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Iterator<String> actionsIterator ()
```

Return an iterator over the filter's actions. If there are no actions, returns null.

<br />

|                                                                        Returns                                                                         ||
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[String](https://developer.android.com/reference/java/lang/String)`>` | <br /> |

### addAction

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void addAction (String action)
```

Add a new Intent action to match against. If any actions are included in the filter, then an Intent's action must be one of those values for it to match. If no actions are included, the Intent action is ignored.

<br />

|                                     Parameters                                      ||
|----------|---------------------------------------------------------------------------|
| `action` | `String`: Name of the action to match, such as Intent.ACTION_VIEW. <br /> |

### addCategory

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void addCategory (String category)
```

Add a new Intent category to match against. The semantics of categories is the opposite of actions -- an Intent includes the categories that it requires, all of which must be included in the filter in order to match. In other words, adding a category to the filter has no impact on matching unless that category is specified in the intent.

<br />

|                                       Parameters                                       ||
|------------|----------------------------------------------------------------------------|
| `category` | `String`: Name of category to match, such as Intent.CATEGORY_EMBED. <br /> |

### addDataAuthority

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void addDataAuthority (String host, 
                String port)
```

Add a new Intent data authority to match against. The filter must include one or more schemes (via[addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String))) for the authority to be considered. If any authorities are included in the filter, then an Intent's data must match one of them. If no authorities are included, then only the scheme must match.

*Note: host name in the Android framework is case-sensitive, unlike formal RFC host names. As a result, you should always write your host names with lower case letters, and any host names you receive from outside of Android should be converted to lower case before supplying them here.*

<br />

<br />

|                                                               Parameters                                                               ||
|--------|--------------------------------------------------------------------------------------------------------------------------------|
| `host` | `String`: The host part of the authority to match. May start with a single '\*' to wildcard the front of the host name. <br /> |
| `port` | `String`: Optional port part of the authority to match. If null, any port is allowed. <br />                                   |

**See also:**

- [matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri))
- [addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String))  

### addDataPath

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void addDataPath (String path, 
                int type)
```

Add a new Intent data path to match against. The filter must include one or more schemes (via[addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String)))*and* one or more authorities (via[addDataAuthority(String, String)](https://developer.android.com/reference/android/content/IntentFilter#addDataAuthority(java.lang.String,%20java.lang.String))) for the path to be considered. If any paths are included in the filter, then an Intent's data must match one of them. If no paths are included, then only the scheme/authority must match.

The path given here can either be a literal that must directly match or match against a prefix, or it can be a simple globbing pattern. If the latter, you can use '\*' anywhere in the pattern to match zero or more instances of the previous character, '.' as a wildcard to match any character, and '\\' to escape the next character.

<br />

|                                                                                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                                                                               ||
|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `path` | `String`: Either a raw string that must exactly match the file path, or a simple pattern, depending on<var translate="no">type</var>. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `type` | `int`: Determines how<var translate="no">path</var>will be compared to determine a match: either[PatternMatcher.PATTERN_LITERAL](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_LITERAL),[PatternMatcher.PATTERN_PREFIX](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_PREFIX),[PatternMatcher.PATTERN_SUFFIX](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_SUFFIX), or[PatternMatcher.PATTERN_SIMPLE_GLOB](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_SIMPLE_GLOB). <br /> |

**See also:**

- [matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri))
- [addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String))
- [addDataAuthority(String, String)](https://developer.android.com/reference/android/content/IntentFilter#addDataAuthority(java.lang.String,%20java.lang.String))  

### addDataScheme

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void addDataScheme (String scheme)
```

Add a new Intent data scheme to match against. If any schemes are included in the filter, then an Intent's data must be*either* one of these schemes*or*a matching data type. If no schemes are included, then an Intent will match only if it includes no data.

*Note: scheme matching in the Android framework is case-sensitive, unlike formal RFC schemes. As a result, you should always write your schemes with lower case letters, and any schemes you receive from outside of Android should be converted to lower case before supplying them here.*

<br />

<br />

|                               Parameters                                ||
|----------|---------------------------------------------------------------|
| `scheme` | `String`: Name of the scheme to match, such as "http". <br /> |

**See also:**

- [matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri))  

### addDataSchemeSpecificPart

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void addDataSchemeSpecificPart (String ssp, 
                int type)
```

Add a new Intent data "scheme specific part" to match against. The filter must include one or more schemes (via[addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String))) for the scheme specific part to be considered. If any scheme specific parts are included in the filter, then an Intent's data must match one of them. If no scheme specific parts are included, then only the scheme must match.

The "scheme specific part" that this matches against is the string returned by[Uri.getSchemeSpecificPart](https://developer.android.com/reference/android/net/Uri#getSchemeSpecificPart()). For Uris that contain a path, this kind of matching is not generally of interest, since[addDataAuthority(java.lang.String, java.lang.String)](https://developer.android.com/reference/android/content/IntentFilter#addDataAuthority(java.lang.String,%20java.lang.String))and[addDataPath(java.lang.String, int)](https://developer.android.com/reference/android/content/IntentFilter#addDataPath(java.lang.String,%20int))can provide a better mechanism for matching them. However, for Uris that do not contain a path, the authority and path are empty, so this is the only way to match against the non-scheme part.

<br />

<br />

|                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                               ||
|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ssp`  | `String`: Either a raw string that must exactly match the scheme specific part path, or a simple pattern, depending on<var translate="no">type</var>. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `type` | `int`: Determines how<var translate="no">ssp</var>will be compared to determine a match: either[PatternMatcher.PATTERN_LITERAL](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_LITERAL),[PatternMatcher.PATTERN_PREFIX](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_PREFIX),[PatternMatcher.PATTERN_SUFFIX](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_SUFFIX), or[PatternMatcher.PATTERN_SIMPLE_GLOB](https://developer.android.com/reference/android/os/PatternMatcher#PATTERN_SIMPLE_GLOB). <br /> |

**See also:**

- [matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri))
- [addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String))  

### addDataType

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void addDataType (String type)
```

Add a new Intent data type to match against. If any types are included in the filter, then an Intent's data must be*either* one of these types*or*a matching scheme. If no data types are included, then an Intent will only match if it specifies no data.

*Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types. As a result, you should always write your MIME types with lower case letters, and any MIME types you receive from outside of Android should be converted to lower case before supplying them here.*

Throws[MalformedMimeTypeException](https://developer.android.com/reference/android/content/IntentFilter.MalformedMimeTypeException)if the given MIME type is not syntactically correct.

<br />

|                                            Parameters                                             ||
|--------|-------------------------------------------------------------------------------------------|
| `type` | `String`: Name of the data type to match, such as "vnd.android.cursor.dir/person". <br /> |

|                                                                    Throws                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------|---|
| [IntentFilter.MalformedMimeTypeException](https://developer.android.com/reference/android/content/IntentFilter.MalformedMimeTypeException) |   |

**See also:**

- [matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri))  

### addUriRelativeFilterGroup

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void addUriRelativeFilterGroup (UriRelativeFilterGroup group)
```

Add a new URI relative filter group to match against the Intent data. The intent filter must include one or more schemes (via[addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String)))*and* one or more authorities (via[addDataAuthority(String, String)](https://developer.android.com/reference/android/content/IntentFilter#addDataAuthority(java.lang.String,%20java.lang.String))) for the group to be considered.

Groups will be matched in the order they were added and matching will only be done if no data paths match or if none are included. If both data paths and groups are not included, then only the scheme/authority must match.

<br />

<br />

|                                                                                            Parameters                                                                                            ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `group` | `UriRelativeFilterGroup`: A[UriRelativeFilterGroup](https://developer.android.com/reference/android/content/UriRelativeFilterGroup)to match the URI. This value cannot be`null`. <br /> |

**See also:**

- [UriRelativeFilterGroup](https://developer.android.com/reference/android/content/UriRelativeFilterGroup)
- [matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri))
- [addDataScheme(String)](https://developer.android.com/reference/android/content/IntentFilter#addDataScheme(java.lang.String))
- [addDataAuthority(String, String)](https://developer.android.com/reference/android/content/IntentFilter#addDataAuthority(java.lang.String,%20java.lang.String))  

### asPredicate

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Predicate<Intent> asPredicate ()
```

Return a[Predicate](https://developer.android.com/reference/java/util/function/Predicate)which tests whether this filter matches the given<var translate="no">intent</var>.

The intent's type will always be tested using a simple[Intent.getType()](https://developer.android.com/reference/android/content/Intent#getType())check. To instead perform a detailed type resolution before matching, use[asPredicateWithTypeResolution(android.content.ContentResolver)](https://developer.android.com/reference/android/content/IntentFilter#asPredicateWithTypeResolution(android.content.ContentResolver)).

<br />

|                                                                                               Returns                                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [Predicate](https://developer.android.com/reference/java/util/function/Predicate)`<`[Intent](https://developer.android.com/reference/android/content/Intent)`>` | This value cannot be`null`. <br /> |

### asPredicateWithTypeResolution

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Predicate<Intent> asPredicateWithTypeResolution (ContentResolver resolver)
```

Return a[Predicate](https://developer.android.com/reference/java/util/function/Predicate)which tests whether this filter matches the given<var translate="no">intent</var>.

The intent's type will always be resolved by calling[Intent.resolveType(ContentResolver)](https://developer.android.com/reference/android/content/Intent#resolveType(android.content.ContentResolver))before matching.

<br />

|                                                                                                                         Parameters                                                                                                                          ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `resolver` | `ContentResolver`: to be used when calling[Intent.resolveType(ContentResolver)](https://developer.android.com/reference/android/content/Intent#resolveType(android.content.ContentResolver))before matching. This value cannot be`null`. <br /> |

|                                                                                               Returns                                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [Predicate](https://developer.android.com/reference/java/util/function/Predicate)`<`[Intent](https://developer.android.com/reference/android/content/Intent)`>` | This value cannot be`null`. <br /> |

### authoritiesIterator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Iterator<IntentFilter.AuthorityEntry> authoritiesIterator ()
```

Return an iterator over the filter's data authorities.

<br />

|                                                                                                Returns                                                                                                 ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[IntentFilter.AuthorityEntry](https://developer.android.com/reference/android/content/IntentFilter.AuthorityEntry)`>` | <br /> |

### categoriesIterator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Iterator<String> categoriesIterator ()
```

Return an iterator over the filter's categories.

<br />

|                                                                                                    Returns                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|
| [Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[String](https://developer.android.com/reference/java/lang/String)`>` | Iterator if this filter has categories or`null`if none. <br /> |

### clearUriRelativeFilterGroups

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void clearUriRelativeFilterGroups ()
```

Removes all existing URI relative filter groups in the intent filter.

<br />

### countActions

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int countActions ()
```

Return the number of actions in the filter.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### countCategories

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int countCategories ()
```

Return the number of categories in the filter.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### countDataAuthorities

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int countDataAuthorities ()
```

Return the number of data authorities in the filter.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### countDataPaths

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int countDataPaths ()
```

Return the number of data paths in the filter.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### countDataSchemeSpecificParts

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int countDataSchemeSpecificParts ()
```

Return the number of data scheme specific parts in the filter.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### countDataSchemes

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int countDataSchemes ()
```

Return the number of data schemes in the filter.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### countDataTypes

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int countDataTypes ()
```

Return the number of data types in the filter.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### countUriRelativeFilterGroups

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int countUriRelativeFilterGroups ()
```

Return the number of URI relative filter groups in the intent filter.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### create

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static IntentFilter create (String action, 
                String dataType)
```

Create a new IntentFilter instance with a specified action and MIME type, where you know the MIME type is correctly formatted. This catches the[MalformedMimeTypeException](https://developer.android.com/reference/android/content/IntentFilter.MalformedMimeTypeException)exception that the constructor can call and turns it into a runtime exception.

<br />

|                                        Parameters                                        ||
|------------|------------------------------------------------------------------------------|
| `action`   | `String`: The action to match, such as Intent.ACTION_VIEW. <br />            |
| `dataType` | `String`: The type to match, such as "vnd.android.cursor.dir/person". <br /> |

|                                                                    Returns                                                                     ||
|--------------------------------------------------------------------------------------|----------------------------------------------------------|
| [IntentFilter](https://developer.android.com/reference/android/content/IntentFilter) | A new IntentFilter for the given action and type. <br /> |

**See also:**

- [IntentFilter(String, String)](https://developer.android.com/reference/android/content/IntentFilter#IntentFilter(java.lang.String,%20java.lang.String))  

### describeContents

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of[writeToParcel(android.os.Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)), the return value of this method must include the[CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR)bit.

<br />

|                                                                                                                         Returns                                                                                                                         ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) <br /> |

### dump

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void dump (Printer du, 
                String prefix)
```

<br />

<br />

|         Parameters         ||
|----------|------------------|
| `du`     | `Printer` <br /> |
| `prefix` | `String` <br />  |

### getAction

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final String getAction (int index)
```

Return an action in the filter.

<br />

|      Parameters       ||
|---------|--------------|
| `index` | `int` <br /> |

|                                  Returns                                   ||
|--------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String) | <br /> |

### getCategory

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final String getCategory (int index)
```

Return a category in the filter.

<br />

|      Parameters       ||
|---------|--------------|
| `index` | `int` <br /> |

|                                  Returns                                   ||
|--------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String) | <br /> |

### getDataAuthority

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final IntentFilter.AuthorityEntry getDataAuthority (int index)
```

Return a data authority in the filter.

<br />

|      Parameters       ||
|---------|--------------|
| `index` | `int` <br /> |

|                                                          Returns                                                           ||
|--------------------------------------------------------------------------------------------------------------------|--------|
| [IntentFilter.AuthorityEntry](https://developer.android.com/reference/android/content/IntentFilter.AuthorityEntry) | <br /> |

### getDataPath

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final PatternMatcher getDataPath (int index)
```

Return a data path in the filter.

<br />

|      Parameters       ||
|---------|--------------|
| `index` | `int` <br /> |

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| [PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher) | <br /> |

### getDataScheme

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final String getDataScheme (int index)
```

Return a data scheme in the filter.

<br />

|      Parameters       ||
|---------|--------------|
| `index` | `int` <br /> |

|                                  Returns                                   ||
|--------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String) | <br /> |

### getDataSchemeSpecificPart

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final PatternMatcher getDataSchemeSpecificPart (int index)
```

Return a data scheme specific part in the filter.

<br />

|      Parameters       ||
|---------|--------------|
| `index` | `int` <br /> |

|                                           Returns                                           ||
|-------------------------------------------------------------------------------------|--------|
| [PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher) | <br /> |

### getDataType

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final String getDataType (int index)
```

Return a data type in the filter.

<br />

|      Parameters       ||
|---------|--------------|
| `index` | `int` <br /> |

|                                  Returns                                   ||
|--------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String) | <br /> |

### getPriority

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int getPriority ()
```

Return the priority of this filter.

<br />

|                  Returns                  ||
|-------|------------------------------------|
| `int` | The priority of the filter. <br /> |

**See also:**

- [setPriority(int)](https://developer.android.com/reference/android/content/IntentFilter#setPriority(int))  

### getUriRelativeFilterGroup

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final UriRelativeFilterGroup getUriRelativeFilterGroup (int index)
```

Return a URI relative filter group in the intent filter.

Note: use of this method will result in a NullPointerException if no groups exists for this intent filter.

<br />

<br />

|                      Parameters                       ||
|---------|----------------------------------------------|
| `index` | `int`: index of the element to return <br /> |

|                                                                   Returns                                                                    ||
|----------------------------------------------------------------------------------------------------------|------------------------------------|
| [UriRelativeFilterGroup](https://developer.android.com/reference/android/content/UriRelativeFilterGroup) | This value cannot be`null`. <br /> |

|                                                               Throws                                                               ||
|----------------------------------------------------------------------------------------------------------|--------------------------|
| [IndexOutOfBoundsException](https://developer.android.com/reference/java/lang/IndexOutOfBoundsException) | if index is out of range |

### hasAction

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean hasAction (String action)
```

Is the given action included in the filter? Note that if the filter does not include any actions, false will*always*be returned.

<br />

|                     Parameters                     ||
|----------|------------------------------------------|
| `action` | `String`: The action to look for. <br /> |

|                                   Returns                                   ||
|-----------|------------------------------------------------------------------|
| `boolean` | True if the action is explicitly mentioned in the filter. <br /> |

### hasCategory

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean hasCategory (String category)
```

Is the given category included in the filter?

<br />

|                             Parameters                              ||
|------------|---------------------------------------------------------|
| `category` | `String`: The category that the filter supports. <br /> |

|                                    Returns                                    ||
|-----------|--------------------------------------------------------------------|
| `boolean` | True if the category is explicitly mentioned in the filter. <br /> |

### hasDataAuthority

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean hasDataAuthority (Uri data)
```

Is the given data authority included in the filter? Note that if the filter does not include any authorities, false will*always*be returned.

<br />

|                             Parameters                              ||
|--------|-------------------------------------------------------------|
| `data` | `Uri`: The data whose authority is being looked for. <br /> |

|                                           Returns                                            ||
|-----------|-----------------------------------------------------------------------------------|
| `boolean` | Returns true if the data string matches an authority listed in the filter. <br /> |

### hasDataPath

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean hasDataPath (String data)
```

Is the given data path included in the filter? Note that if the filter does not include any paths, false will*always*be returned.

<br />

|                                       Parameters                                       ||
|--------|--------------------------------------------------------------------------------|
| `data` | `String`: The data path to look for. This is without the scheme prefix. <br /> |

|                                    Returns                                     ||
|-----------|---------------------------------------------------------------------|
| `boolean` | True if the data string matches a path listed in the filter. <br /> |

### hasDataScheme

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean hasDataScheme (String scheme)
```

Is the given data scheme included in the filter? Note that if the filter does not include any scheme, false will*always*be returned.

<br />

|                       Parameters                        ||
|----------|-----------------------------------------------|
| `scheme` | `String`: The data scheme to look for. <br /> |

|                                   Returns                                   ||
|-----------|------------------------------------------------------------------|
| `boolean` | True if the scheme is explicitly mentioned in the filter. <br /> |

### hasDataSchemeSpecificPart

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean hasDataSchemeSpecificPart (String data)
```

Is the given data scheme specific part included in the filter? Note that if the filter does not include any scheme specific parts, false will*always*be returned.

<br />

|                                 Parameters                                  ||
|--------|---------------------------------------------------------------------|
| `data` | `String`: The scheme specific part that is being looked for. <br /> |

|                                                Returns                                                 ||
|-----------|---------------------------------------------------------------------------------------------|
| `boolean` | Returns true if the data string matches a scheme specific part listed in the filter. <br /> |

### hasDataType

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean hasDataType (String type)
```

Is the given data type included in the filter? Note that if the filter does not include any type, false will*always*be returned.

<br />

|                     Parameters                      ||
|--------|---------------------------------------------|
| `type` | `String`: The data type to look for. <br /> |

|                                  Returns                                  ||
|-----------|----------------------------------------------------------------|
| `boolean` | True if the type is explicitly mentioned in the filter. <br /> |

### match

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int match (String action, 
                String type, 
                String scheme, 
                Uri data, 
                Set<String> categories, 
                String logTag)
```

Test whether this filter matches the given intent data. A match is only successful if the actions and categories in the Intent match against the filter, as described in[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter); in that case, the match result returned will be as per[matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri)).

<br />

|                                       Parameters                                        ||
|--------------|---------------------------------------------------------------------------|
| `action`     | `String`: The intent action to match against (Intent.getAction). <br />   |
| `type`       | `String`: The intent type to match against (Intent.resolveType()). <br /> |
| `scheme`     | `String`: The data scheme to match against (Intent.getScheme()). <br />   |
| `data`       | `Uri`: The data URI to match against (Intent.getData()). <br />           |
| `categories` | `Set`: The categories to match against (Intent.getCategories()). <br />   |
| `logTag`     | `String`: Tag to use in debugging messages. <br />                        |

|                                                                                                                                                                                                                                                                                                                                                                                                                                           Returns                                                                                                                                                                                                                                                                                                                                                                                                                                            ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Returns either a valid match constant (a combination of[MATCH_CATEGORY_MASK](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_MASK)and[MATCH_ADJUSTMENT_MASK](https://developer.android.com/reference/android/content/IntentFilter#MATCH_ADJUSTMENT_MASK)), or one of the error codes[NO_MATCH_TYPE](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_TYPE)if the type didn't match,[NO_MATCH_DATA](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_DATA)if the scheme/path didn't match,[NO_MATCH_ACTION](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_ACTION)if the action didn't match, or[NO_MATCH_CATEGORY](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_CATEGORY)if one or more categories didn't match. <br /> |

**See also:**

- [matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri))
- [Intent.getAction()](https://developer.android.com/reference/android/content/Intent#getAction())
- [Intent.resolveType(ContentResolver)](https://developer.android.com/reference/android/content/Intent#resolveType(android.content.ContentResolver))
- [Intent.getScheme()](https://developer.android.com/reference/android/content/Intent#getScheme())
- [Intent.getData()](https://developer.android.com/reference/android/content/Intent#getData())
- [Intent.getCategories()](https://developer.android.com/reference/android/content/Intent#getCategories())  

### match

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int match (ContentResolver resolver, 
                Intent intent, 
                boolean resolve, 
                String logTag)
```

Test whether this filter matches the given<var translate="no">intent</var>.

<br />

|                                                                                 Parameters                                                                                 ||
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `resolver` | `ContentResolver` <br />                                                                                                                                       |
| `intent`   | `Intent`: The Intent to compare against. <br />                                                                                                                |
| `resolve`  | `boolean`: If true, the intent's type will be resolved by calling Intent.resolveType(); otherwise a simple match against Intent.type will be performed. <br /> |
| `logTag`   | `String`: Tag to use in debugging messages. <br />                                                                                                             |

|                                                                                                                                                                                                                                                                                                                                                                                                                                           Returns                                                                                                                                                                                                                                                                                                                                                                                                                                            ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Returns either a valid match constant (a combination of[MATCH_CATEGORY_MASK](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_MASK)and[MATCH_ADJUSTMENT_MASK](https://developer.android.com/reference/android/content/IntentFilter#MATCH_ADJUSTMENT_MASK)), or one of the error codes[NO_MATCH_TYPE](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_TYPE)if the type didn't match,[NO_MATCH_DATA](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_DATA)if the scheme/path didn't match,[NO_MATCH_ACTION](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_ACTION)if the action didn't match, or[NO_MATCH_CATEGORY](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_CATEGORY)if one or more categories didn't match. <br /> |

**See also:**

- [match(String, String, String, android.net.Uri, Set, String)](https://developer.android.com/reference/android/content/IntentFilter#match(java.lang.String,%20java.lang.String,%20java.lang.String,%20android.net.Uri,%20java.util.Set<java.lang.String>,%20java.lang.String))  

### matchAction

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean matchAction (String action)
```

Match this filter against an Intent's action. If the filter does not specify any actions, the match will always fail.

<br />

|                         Parameters                         ||
|----------|--------------------------------------------------|
| `action` | `String`: The desired action to look for. <br /> |

|                            Returns                            ||
|-----------|----------------------------------------------------|
| `boolean` | True if the action is listed in the filter. <br /> |

### matchCategories

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final String matchCategories (Set<String> categories)
```

Match this filter against an Intent's categories. Each category in the Intent must be specified by the filter; if any are not in the filter, the match fails.

<br />

|                                                Parameters                                                 ||
|--------------|---------------------------------------------------------------------------------------------|
| `categories` | `Set`: The categories included in the intent, as returned by Intent.getCategories(). <br /> |

|                                                                                  Returns                                                                                   ||
|--------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | If all categories match (success), null; else the name of the first category that didn't match. <br /> |

### matchData

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int matchData (String type, 
                String scheme, 
                Uri data)
```

Match this filter against an Intent's data (type, scheme and path). If the filter does not specify any types and does not specify any schemes/paths, the match will only succeed if the intent does not also specify a type or data. If the filter does not specify any schemes, it will implicitly match intents with no scheme, or the schemes "content:" or "file:" (basically performing a MIME-type only match). If the filter does not specify any MIME types, the Intent also must not specify a MIME type.

Be aware that to match against an authority, you must also specify a base scheme the authority is in. To match against a data path, both a scheme and authority must be specified. If the filter does not specify any types or schemes that it matches against, it is considered to be empty (any authority or data path given is ignored, as if it were empty as well).

*Note: MIME type, Uri scheme, and host name matching in the Android framework is case-sensitive, unlike the formal RFC definitions. As a result, you should always write these elements with lower case letters, and normalize any MIME types or Uris you receive from outside of Android to ensure these elements are lower case before supplying them here.*

<br />

<br />

|                                             Parameters                                             ||
|----------|------------------------------------------------------------------------------------------|
| `type`   | `String`: The desired data type to look for, as returned by Intent.resolveType(). <br /> |
| `scheme` | `String`: The desired data scheme to look for, as returned by Intent.getScheme(). <br /> |
| `data`   | `Uri`: The full data string to match against, as supplied in Intent.data. <br />         |

|                                                                                                                                                                                                                                                                                                 Returns                                                                                                                                                                                                                                                                                                 ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Returns either a valid match constant (a combination of[MATCH_CATEGORY_MASK](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_MASK)and[MATCH_ADJUSTMENT_MASK](https://developer.android.com/reference/android/content/IntentFilter#MATCH_ADJUSTMENT_MASK)), or one of the error codes[NO_MATCH_TYPE](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_TYPE)if the type didn't match or[NO_MATCH_DATA](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_DATA)if the scheme/path didn't match. <br /> |

**See also:**

- [match(ContentResolver, Intent, boolean, String)](https://developer.android.com/reference/android/content/IntentFilter#match(android.content.ContentResolver,%20android.content.Intent,%20boolean,%20java.lang.String))  

### matchDataAuthority

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int matchDataAuthority (Uri data)
```

Match this intent filter against the given Intent data. This ignores the data scheme -- unlike[matchData(String, String, Uri)](https://developer.android.com/reference/android/content/IntentFilter#matchData(java.lang.String,%20java.lang.String,%20android.net.Uri)), the authority will match regardless of whether there is a matching scheme.

<br />

|                             Parameters                              ||
|--------|-------------------------------------------------------------|
| `data` | `Uri`: The data whose authority is being looked for. <br /> |

|                                                                                                                                                                             Returns                                                                                                                                                                              ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Returns either[MATCH_CATEGORY_HOST](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_HOST),[MATCH_CATEGORY_PORT](https://developer.android.com/reference/android/content/IntentFilter#MATCH_CATEGORY_PORT),[NO_MATCH_DATA](https://developer.android.com/reference/android/content/IntentFilter#NO_MATCH_DATA). <br /> |

### pathsIterator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Iterator<PatternMatcher> pathsIterator ()
```

Return an iterator over the filter's data paths.

<br />

|                                                                                 Returns                                                                                 ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher)`>` | <br /> |

### readFromXml

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void readFromXml (XmlPullParser parser)
```

<br />

<br />

|            Parameters            ||
|----------|------------------------|
| `parser` | `XmlPullParser` <br /> |

|                                                   Throws                                                   ||
|---------------------------------------------------------------------------------------------------------|---|
| [IOException](https://developer.android.com/reference/java/io/IOException)                              |   |
| [XmlPullParserException](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParserException) |   |

### schemeSpecificPartsIterator

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Iterator<PatternMatcher> schemeSpecificPartsIterator ()
```

Return an iterator over the filter's data scheme specific parts.

<br />

|                                                                                 Returns                                                                                 ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[PatternMatcher](https://developer.android.com/reference/android/os/PatternMatcher)`>` | <br /> |

### schemesIterator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Iterator<String> schemesIterator ()
```

Return an iterator over the filter's data schemes.

<br />

|                                                                        Returns                                                                         ||
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[String](https://developer.android.com/reference/java/lang/String)`>` | <br /> |

### setPriority

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void setPriority (int priority)
```

Modify priority of this filter. This only affects receiver filters. The priority of activity filters are set in XML and cannot be changed programmatically. The default priority is 0. Positive values will be before the default, lower values will be after it. Applications should use a value that is larger than[SYSTEM_LOW_PRIORITY](https://developer.android.com/reference/android/content/IntentFilter#SYSTEM_LOW_PRIORITY)and smaller than[SYSTEM_HIGH_PRIORITY](https://developer.android.com/reference/android/content/IntentFilter#SYSTEM_HIGH_PRIORITY).

<br />

|                    Parameters                     ||
|------------|---------------------------------------|
| `priority` | `int`: The new priority value. <br /> |

**See also:**

- [getPriority()](https://developer.android.com/reference/android/content/IntentFilter#getPriority())
- [SYSTEM_LOW_PRIORITY](https://developer.android.com/reference/android/content/IntentFilter#SYSTEM_LOW_PRIORITY)
- [SYSTEM_HIGH_PRIORITY](https://developer.android.com/reference/android/content/IntentFilter#SYSTEM_HIGH_PRIORITY)  

### typesIterator

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final Iterator<String> typesIterator ()
```

Return an iterator over the filter's data types.

<br />

|                                                                        Returns                                                                         ||
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Iterator](https://developer.android.com/reference/java/util/Iterator)`<`[String](https://developer.android.com/reference/java/lang/String)`>` | <br /> |

### writeToParcel

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

|                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | `Parcel`: The Parcel in which the object should be written. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                 |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE). Value is either`0`or a combination of[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES <br /> |

### writeToXml

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void writeToXml (XmlSerializer serializer)
```

Write the contents of the IntentFilter as an XML stream.

<br />

|              Parameters              ||
|--------------|------------------------|
| `serializer` | `XmlSerializer` <br /> |

|                                    Throws                                     ||
|----------------------------------------------------------------------------|---|
| [IOException](https://developer.android.com/reference/java/io/IOException) |   |