<data android:host="string" android:mimeType="string" android:path="string" android:pathPattern="string" android:pathPrefix="string" android:port="string" android:scheme="string" />
mimeTypeattribute), just a URI, or both a data type and a URI. A URI is specified by separate attributes for each of its parts:
These attributes are optional, but also mutually dependent:
scheme is not specified for the
intent filter, all the other URI attributes are ignored. If a
host is not specified for the filter,
port attribute and all the path attributes are ignored.
<data> elements contained within the same
<intent-filter> element contribute to
the same filter. So, for example, the following filter specification,
<intent-filter . . . > <data android:scheme="something" android:host="project.example.com" /> . . . </intent-filter>
is equivalent to this one:
<intent-filter . . . > <data android:scheme="something" /> <data android:host="project.example.com" /> . . . </intent-filter>
You can place any number of <data> elements inside an
<intent-filter> to give it multiple data
options. None of its attributes have default values.
Information on how intent filters work, including the rules for how Intent objects are matched against filters, can be found in another document, Intents and Intent Filters. See also the Intent Filters section in the introduction.
schemeattribute is also specified for the filter.
Note: host name matching in the Android framework is case-sensitive, unlike the formal RFC. As a result, you should always specify host names using lowercase letters.
audio/mpeg4-generic. The subtype can be the asterisk wildcard (
*) to indicate that any subtype matches.
Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types. As a result, you should always specify MIME types using lowercase letters.
pathattribute specifies a complete path that is matched against the complete path in an Intent object. The
pathPrefixattribute specifies a partial path that is matched against only the initial part of the path in the Intent object. The
pathPatternattribute specifies a complete path that is matched against the complete path in the Intent object, but it can contain the following wildcards:
*') matches a sequence of 0 to many occurrences of the immediately preceding character.
.*") matches any sequence of 0 to many characters.
\' is used as an escape character when the string is read
from XML (before it is parsed as a pattern), you will need to double-escape:
For example, a literal '
*' would be written as "
\\*" and a
\' would be written as "
\\\\". This is basically
the same as what you would need to write if constructing the string in Java code.
For more information on these three types of patterns, see the descriptions of
PATTERN_SIMPLE_GLOB in the
These attributes are meaningful only if the
attributes are also specified for the filter.
hostattributes are also specified for the filter.
schemeattribute must be set for the filter, or none of the other URI attributes are meaningful.
A scheme is specified without the trailing colon (for example,
http, rather than
If the filter has a data type set (the
attribute) but no scheme, the
file: schemes are
Note: scheme matching in the Android framework is case-sensitive, unlike the RFC. As a result, you should always specify schemes using lowercase letters.