public class IntentFilter extends Object implements Parcelable
IntentFilter objects are often created in XML as part of a package's
AndroidManifest.xml
file,
using intent-filter
tags.
There are three Intent characteristics you can filter on: the
action, data, and categories. For each of these
characteristics you can provide
multiple possible matching values (via addAction(java.lang.String)
,
addDataType(java.lang.String)
, addDataScheme(java.lang.String)
, addDataSchemeSpecificPart(java.lang.String, int)
,
addDataAuthority(java.lang.String, java.lang.String)
, addDataPath(java.lang.String, int)
, and addCategory(java.lang.String)
, respectively).
For actions, the field
will not be tested if no values have been given (treating it as a wildcard);
if no data characteristics are specified, however, 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.
For information about how to create and resolve intents, read the Intents and Intent Filters developer guide.
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(ContentResolver, Intent, boolean, 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(android.content.Context)
. 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()
and 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()
and 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 authories were supplied in the filter.
The Intent authority is determined by calling
Intent.getData()
and 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()
and 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.
Modifier and Type | Class and Description |
---|---|
static class |
IntentFilter.AuthorityEntry
This is an entry for a single authority in the Iterator returned by
authoritiesIterator() . |
static class |
IntentFilter.MalformedMimeTypeException
This exception is thrown when a given MIME type does not have a valid
syntax.
|
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<IntentFilter> |
CREATOR |
static int |
MATCH_ADJUSTMENT_MASK
The part of a match constant that applies a quality adjustment to the
basic category of match.
|
static 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.
|
static int |
MATCH_CATEGORY_EMPTY
The filter matched an intent that had no data specified.
|
static int |
MATCH_CATEGORY_HOST
The filter matched an intent with the same data URI scheme and
authority host.
|
static int |
MATCH_CATEGORY_MASK
The part of a match constant that describes the category of match
that occurred.
|
static int |
MATCH_CATEGORY_PATH
The filter matched an intent with the same data URI scheme,
authority, and path.
|
static int |
MATCH_CATEGORY_PORT
The filter matched an intent with the same data URI scheme and
authority host and port.
|
static int |
MATCH_CATEGORY_SCHEME
The filter matched an intent with the same data URI scheme.
|
static int |
MATCH_CATEGORY_SCHEME_SPECIFIC_PART
The filter matched an intent with the same data URI scheme and
scheme specific part.
|
static int |
MATCH_CATEGORY_TYPE
The filter matched an intent with the same data MIME type.
|
static int |
NO_MATCH_ACTION
The filter didn't match due to different actions.
|
static int |
NO_MATCH_CATEGORY
The filter didn't match because it required one or more categories
that were not in the Intent.
|
static int |
NO_MATCH_DATA
The filter didn't match due to different data URIs.
|
static int |
NO_MATCH_TYPE
The filter didn't match due to different MIME types.
|
static String |
SCHEME_HTTP
HTTP scheme.
|
static String |
SCHEME_HTTPS
HTTPS scheme.
|
static int |
SYSTEM_HIGH_PRIORITY
The filter
setPriority(int) value at which system high-priority
receivers are placed; that is, receivers that should execute before
application code. |
static int |
SYSTEM_LOW_PRIORITY
The filter
setPriority(int) value at which system low-priority
receivers are placed; that is, receivers that should execute after
application code. |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
IntentFilter()
New empty IntentFilter.
|
IntentFilter(IntentFilter o)
New IntentFilter containing a copy of an existing filter.
|
IntentFilter(String action)
New IntentFilter that matches a single action with no data.
|
IntentFilter(String action,
String dataType)
New IntentFilter that matches a single action and data type.
|
Modifier and Type | Method and Description |
---|---|
Iterator<String> |
actionsIterator()
Return an iterator over the filter's actions.
|
void |
addAction(String action)
Add a new Intent action to match against.
|
void |
addCategory(String category)
Add a new Intent category to match against.
|
void |
addDataAuthority(IntentFilter.AuthorityEntry ent) |
void |
addDataAuthority(String host,
String port)
Add a new Intent data authority to match against.
|
void |
addDataPath(PatternMatcher path) |
void |
addDataPath(String path,
int type)
Add a new Intent data path to match against.
|
void |
addDataScheme(String scheme)
Add a new Intent data scheme to match against.
|
void |
addDataSchemeSpecificPart(PatternMatcher ssp) |
void |
addDataSchemeSpecificPart(String ssp,
int type)
Add a new Intent data "scheme specific part" to match against.
|
void |
addDataType(String type)
Add a new Intent data type to match against.
|
Iterator<IntentFilter.AuthorityEntry> |
authoritiesIterator()
Return an iterator over the filter's data authorities.
|
Iterator<String> |
categoriesIterator()
Return an iterator over the filter's categories.
|
int |
countActions()
Return the number of actions in the filter.
|
int |
countCategories()
Return the number of categories in the filter.
|
int |
countDataAuthorities()
Return the number of data authorities in the filter.
|
int |
countDataPaths()
Return the number of data paths in the filter.
|
int |
countDataSchemes()
Return the number of data schemes in the filter.
|
int |
countDataSchemeSpecificParts()
Return the number of data scheme specific parts in the filter.
|
int |
countDataTypes()
Return the number of data types in the filter.
|
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.
|
boolean |
debugCheck()
For debugging -- perform a check on the filter, return true if it passed
or false if it failed.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
void |
dump(Printer du,
String prefix) |
String |
getAction(int index)
Return an action in the filter.
|
boolean |
getAutoVerify()
Return if this filter will needs to be automatically verified again its data URIs or not.
|
String |
getCategory(int index)
Return a category in the filter.
|
IntentFilter.AuthorityEntry |
getDataAuthority(int index)
Return a data authority in the filter.
|
PatternMatcher |
getDataPath(int index)
Return a data path in the filter.
|
String |
getDataScheme(int index)
Return a data scheme in the filter.
|
PatternMatcher |
getDataSchemeSpecificPart(int index)
Return a data scheme specific part in the filter.
|
String |
getDataType(int index)
Return a data type in the filter.
|
String[] |
getHosts() |
ArrayList<String> |
getHostsList() |
int |
getOrder() |
int |
getPriority()
Return the priority of this filter.
|
boolean |
handleAllWebDataURI()
Return if this filter handle all HTTP or HTTPS data URI or not.
|
boolean |
handlesWebUris(boolean onlyWebSchemes)
Return if this filter handles HTTP or HTTPS data URIs.
|
boolean |
hasAction(String action)
Is the given action included in the filter?
|
boolean |
hasCategory(String category)
Is the given category included in the filter?
|
boolean |
hasDataAuthority(IntentFilter.AuthorityEntry auth) |
boolean |
hasDataAuthority(Uri data)
Is the given data authority included in the filter?
|
boolean |
hasDataPath(PatternMatcher path) |
boolean |
hasDataPath(String data)
Is the given data path included in the filter?
|
boolean |
hasDataScheme(String scheme)
Is the given data scheme included in the filter?
|
boolean |
hasDataSchemeSpecificPart(PatternMatcher ssp) |
boolean |
hasDataSchemeSpecificPart(String data)
Is the given data scheme specific part included in the filter?
|
boolean |
hasDataType(String type)
Is the given data type included in the filter?
|
boolean |
hasExactDataType(String type) |
boolean |
isVerified()
Return if this filter has been verified
|
int |
match(ContentResolver resolver,
Intent intent,
boolean resolve,
String logTag)
Test whether this filter matches the given intent.
|
int |
match(String action,
String type,
String scheme,
Uri data,
Set<String> categories,
String logTag)
Test whether this filter matches the given intent data.
|
boolean |
matchAction(String action)
Match this filter against an Intent's action.
|
String |
matchCategories(Set<String> categories)
Match this filter against an Intent's categories.
|
int |
matchData(String type,
String scheme,
Uri data)
Match this filter against an Intent's data (type, scheme and path).
|
int |
matchDataAuthority(Uri data)
Match this intent filter against the given Intent data.
|
boolean |
needsVerification()
Return if this filter needs to be automatically verified again its data URIs or not.
|
Iterator<PatternMatcher> |
pathsIterator()
Return an iterator over the filter's data paths.
|
void |
readFromXml(XmlPullParser parser) |
Iterator<String> |
schemesIterator()
Return an iterator over the filter's data schemes.
|
Iterator<PatternMatcher> |
schemeSpecificPartsIterator()
Return an iterator over the filter's data scheme specific parts.
|
void |
setAutoVerify(boolean autoVerify)
Set whether this filter will needs to be automatically verified against its data URIs or not.
|
void |
setOrder(int order) |
void |
setPriority(int priority)
Modify priority of this filter.
|
void |
setVerified(boolean verified)
Set if this filter has been verified
|
Iterator<String> |
typesIterator()
Return an iterator over the filter's data types.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
void |
writeToXml(XmlSerializer serializer)
Write the contents of the IntentFilter as an XML stream.
|
public static final int SYSTEM_HIGH_PRIORITY
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.setPriority(int)
,
Constant Field Valuespublic static final int SYSTEM_LOW_PRIORITY
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.setPriority(int)
,
Constant Field Valuespublic static final int MATCH_CATEGORY_MASK
MATCH_CATEGORY_EMPTY
,
MATCH_CATEGORY_SCHEME
, MATCH_CATEGORY_SCHEME_SPECIFIC_PART
,
MATCH_CATEGORY_HOST
, MATCH_CATEGORY_PORT
,
MATCH_CATEGORY_PATH
, or MATCH_CATEGORY_TYPE
. Higher
values indicate a better match.public static final int MATCH_ADJUSTMENT_MASK
MATCH_ADJUSTMENT_NORMAL
is no adjustment; higher numbers than that improve the quality, while
lower numbers reduce it.public static final int MATCH_ADJUSTMENT_NORMAL
public static final int MATCH_CATEGORY_EMPTY
public static final int MATCH_CATEGORY_SCHEME
public static final int MATCH_CATEGORY_HOST
public static final int MATCH_CATEGORY_PORT
public static final int MATCH_CATEGORY_PATH
public static final int MATCH_CATEGORY_SCHEME_SPECIFIC_PART
public static final int MATCH_CATEGORY_TYPE
public static final int NO_MATCH_TYPE
public static final int NO_MATCH_DATA
public static final int NO_MATCH_ACTION
public static final int NO_MATCH_CATEGORY
public static final String SCHEME_HTTP
addDataScheme(String)
,
Constant Field Valuespublic static final String SCHEME_HTTPS
addDataScheme(String)
,
Constant Field Valuespublic static final Parcelable.Creator<IntentFilter> CREATOR
public IntentFilter()
public IntentFilter(String action)
action
- The action to match, such as Intent.ACTION_MAIN.public IntentFilter(String action, String dataType) throws IntentFilter.MalformedMimeTypeException
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 IntentFilter.MalformedMimeTypeException
if the given MIME type is
not syntactically correct.
action
- The action to match, such as Intent.ACTION_VIEW.dataType
- The type to match, such as "vnd.android.cursor.dir/person".IntentFilter.MalformedMimeTypeException
public IntentFilter(IntentFilter o)
o
- The original filter to copy.public static IntentFilter create(String action, String dataType)
IntentFilter.MalformedMimeTypeException
exception that the constructor
can call and turns it into a runtime exception.action
- The action to match, such as Intent.ACTION_VIEW.dataType
- The type to match, such as "vnd.android.cursor.dir/person".IntentFilter(String, String)
public final void setPriority(int priority)
SYSTEM_LOW_PRIORITY
and
smaller than SYSTEM_HIGH_PRIORITY
.priority
- The new priority value.getPriority()
,
SYSTEM_LOW_PRIORITY
,
SYSTEM_HIGH_PRIORITY
public final int getPriority()
setPriority(int)
public final void setOrder(int order)
public final int getOrder()
public final void setAutoVerify(boolean autoVerify)
Intent.ACTION_VIEW
and the Intent category is
Intent.CATEGORY_BROWSABLE
and the Intent data scheme
is "http" or "https".
True means that the filter will need to use its data URIs to be verified.autoVerify
- The new autoVerify value.getAutoVerify()
,
addAction(String)
,
getAction(int)
,
addCategory(String)
,
getCategory(int)
,
addDataScheme(String)
,
getDataScheme(int)
public final boolean getAutoVerify()
setAutoVerify(boolean)
public final boolean handleAllWebDataURI()
Intent.CATEGORY_APP_BROWSER
- either the Intent action is Intent.ACTION_VIEW
and
the Intent category is Intent.CATEGORY_BROWSABLE
and the Intent
data scheme is "http" or "https" and that there is no specific host defined.public final boolean handlesWebUris(boolean onlyWebSchemes)
onlyWebSchemes
- When true, requires that the intent filter declare
that it handles *only* http: or https: schemes. This is a requirement for
the intent filter's domain linkage being verifiable.Intent.ACTION_VIEW
and
the Intent category is Intent.CATEGORY_BROWSABLE
and the Intent
data scheme is "http" or "https".public final boolean needsVerification()
Intent.ACTION_VIEW
and
the Intent category is Intent.CATEGORY_BROWSABLE
and the Intent
data scheme is "http" or "https".setAutoVerify(boolean)
public final boolean isVerified()
public void setVerified(boolean verified)
verified
- true if this filter has been verified. False otherwise.public final void addAction(String action)
action
- Name of the action to match, such as Intent.ACTION_VIEW.public final int countActions()
public final String getAction(int index)
public final boolean hasAction(String action)
action
- The action to look for.public final boolean matchAction(String action)
action
- The desired action to look for.public final Iterator<String> actionsIterator()
public final void addDataType(String type) throws IntentFilter.MalformedMimeTypeException
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 IntentFilter.MalformedMimeTypeException
if the given MIME type is
not syntactically correct.
type
- Name of the data type to match, such as "vnd.android.cursor.dir/person".IntentFilter.MalformedMimeTypeException
matchData(java.lang.String, java.lang.String, android.net.Uri)
public final boolean hasDataType(String type)
type
- The data type to look for.public final boolean hasExactDataType(String type)
public final int countDataTypes()
public final String getDataType(int index)
public final Iterator<String> typesIterator()
public final void addDataScheme(String scheme)
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.
scheme
- Name of the scheme to match, such as "http".matchData(java.lang.String, java.lang.String, android.net.Uri)
public final int countDataSchemes()
public final String getDataScheme(int index)
public final boolean hasDataScheme(String scheme)
scheme
- The data scheme to look for.public final Iterator<String> schemesIterator()
public final void addDataSchemeSpecificPart(String ssp, int type)
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
.
For Uris that contain a path, this kind of matching is not generally of interest,
since addDataAuthority(String, String)
and
addDataPath(String, int)
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.
ssp
- Either a raw string that must exactly match the scheme specific part
path, or a simple pattern, depending on type.type
- Determines how ssp will be compared to
determine a match: either PatternMatcher.PATTERN_LITERAL
,
PatternMatcher.PATTERN_PREFIX
, or
PatternMatcher.PATTERN_SIMPLE_GLOB
.matchData(java.lang.String, java.lang.String, android.net.Uri)
,
addDataScheme(java.lang.String)
public final void addDataSchemeSpecificPart(PatternMatcher ssp)
public final int countDataSchemeSpecificParts()
public final PatternMatcher getDataSchemeSpecificPart(int index)
public final boolean hasDataSchemeSpecificPart(String data)
data
- The scheme specific part that is being looked for.public final boolean hasDataSchemeSpecificPart(PatternMatcher ssp)
public final Iterator<PatternMatcher> schemeSpecificPartsIterator()
public final void addDataAuthority(String host, String port)
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.
host
- The host part of the authority to match. May start with a
single '*' to wildcard the front of the host name.port
- Optional port part of the authority to match. If null, any
port is allowed.matchData(java.lang.String, java.lang.String, android.net.Uri)
,
addDataScheme(java.lang.String)
public final void addDataAuthority(IntentFilter.AuthorityEntry ent)
public final int countDataAuthorities()
public final IntentFilter.AuthorityEntry getDataAuthority(int index)
public final boolean hasDataAuthority(Uri data)
data
- The data whose authority is being looked for.public final boolean hasDataAuthority(IntentFilter.AuthorityEntry auth)
public final Iterator<IntentFilter.AuthorityEntry> authoritiesIterator()
public final void addDataPath(String path, int type)
addDataScheme(java.lang.String)
) and
one or more authorities (via addDataAuthority(java.lang.String, java.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.
path
- Either a raw string that must exactly match the file
path, or a simple pattern, depending on type.type
- Determines how path will be compared to
determine a match: either PatternMatcher.PATTERN_LITERAL
,
PatternMatcher.PATTERN_PREFIX
, or
PatternMatcher.PATTERN_SIMPLE_GLOB
.matchData(java.lang.String, java.lang.String, android.net.Uri)
,
addDataScheme(java.lang.String)
,
addDataAuthority(java.lang.String, java.lang.String)
public final void addDataPath(PatternMatcher path)
public final int countDataPaths()
public final PatternMatcher getDataPath(int index)
public final boolean hasDataPath(String data)
data
- The data path to look for. This is without the scheme
prefix.public final boolean hasDataPath(PatternMatcher path)
public final Iterator<PatternMatcher> pathsIterator()
public final int matchDataAuthority(Uri data)
matchData(java.lang.String, java.lang.String, android.net.Uri)
, the authority will match
regardless of whether there is a matching scheme.data
- The data whose authority is being looked for.MATCH_CATEGORY_HOST
,
MATCH_CATEGORY_PORT
, NO_MATCH_DATA
.public final int matchData(String type, String scheme, Uri data)
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.
type
- The desired data type to look for, as returned by
Intent.resolveType().scheme
- The desired data scheme to look for, as returned by
Intent.getScheme().data
- The full data string to match against, as supplied in
Intent.data.MATCH_CATEGORY_MASK
and MATCH_ADJUSTMENT_MASK
),
or one of the error codes NO_MATCH_TYPE
if the type didn't match
or NO_MATCH_DATA
if the scheme/path didn't match.match(android.content.ContentResolver, android.content.Intent, boolean, java.lang.String)
public final void addCategory(String category)
category
- Name of category to match, such as Intent.CATEGORY_EMBED.public final int countCategories()
public final String getCategory(int index)
public final boolean hasCategory(String category)
category
- The category that the filter supports.public final Iterator<String> categoriesIterator()
null
if none.public final String matchCategories(Set<String> categories)
categories
- The categories included in the intent, as returned by
Intent.getCategories().public final int match(ContentResolver resolver, Intent intent, boolean resolve, String logTag)
intent
- The Intent to compare against.resolve
- If true, the intent's type will be resolved by calling
Intent.resolveType(); otherwise a simple match against
Intent.type will be performed.logTag
- Tag to use in debugging messages.MATCH_CATEGORY_MASK
and MATCH_ADJUSTMENT_MASK
),
or one of the error codes NO_MATCH_TYPE
if the type didn't match,
NO_MATCH_DATA
if the scheme/path didn't match,
NO_MATCH_ACTION
if the action didn't match, or
NO_MATCH_CATEGORY
if one or more categories didn't match.match(String, String, String, android.net.Uri , Set, String)
public final int match(String action, String type, String scheme, Uri data, Set<String> categories, String logTag)
IntentFilter
; in that case,
the match result returned will be as per matchData(java.lang.String, java.lang.String, android.net.Uri)
.action
- The intent action to match against (Intent.getAction).type
- The intent type to match against (Intent.resolveType()).scheme
- The data scheme to match against (Intent.getScheme()).data
- The data URI to match against (Intent.getData()).categories
- The categories to match against
(Intent.getCategories()).logTag
- Tag to use in debugging messages.MATCH_CATEGORY_MASK
and MATCH_ADJUSTMENT_MASK
),
or one of the error codes NO_MATCH_TYPE
if the type didn't match,
NO_MATCH_DATA
if the scheme/path didn't match,
NO_MATCH_ACTION
if the action didn't match, or
NO_MATCH_CATEGORY
if one or more categories didn't match.matchData(java.lang.String, java.lang.String, android.net.Uri)
,
Intent.getAction()
,
Intent.resolveType(android.content.Context)
,
Intent.getScheme()
,
Intent.getData()
,
Intent.getCategories()
public void writeToXml(XmlSerializer serializer) throws IOException
IOException
public void readFromXml(XmlPullParser parser) throws XmlPullParserException, IOException
XmlPullParserException
IOException
public final int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public final void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public boolean debugCheck()
public String[] getHosts()