blob: d0f0edf6dd8c4ddeace55efc6880413d01020fc8 [file] [log] [blame]
parent.title=The AndroidManifest.xml File
<dl class="xml">
<dd><pre class="stx">&lt;category android:<a href="#nm">name</a>="<i>string</i>" /&gt;</pre></dd>
<dt>contained in:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code></dd>
<dd itemprop="description">Adds a category name to an intent filter. See
<a href="{@docRoot}guide/components/intents-filters.html">Intents and
Intent Filters</a> for details on intent filters and the role of category
specifications within a filter.</dd>
<dd><dl class="attr">
<dt><a name="nm"></a>{@code android:name}</dt>
<dd>The name of the category. Standard categories are defined in the
{@link android.content.Intent} class as <code>CATEGORY_<i>name</i></code>
constants. The name assigned here can be derived from those constants
by prefixing "{@code android.intent.category.}" to the
<code><i>name</i></code> that follows {@code CATEGORY_}. For example,
the string value for {@code CATEGORY_LAUNCHER} is
"{@code android.intent.category.LAUNCHER}".
<p class="note"><strong>Note:</strong> In order to receive implicit intents, you must include the
{@link android.content.Intent#CATEGORY_DEFAULT} category in the intent filter. The methods
{@link startActivity()} and
{@link startActivityForResult()} treat all intents
as if they declared the {@link android.content.Intent#CATEGORY_DEFAULT} category.
If you do not declare it in your intent filter, no implicit intents will resolve to
your activity.</p>
Custom categories should use the package name as a prefix, to ensure
that they are unique.
<!-- ##api level indication## -->
<dt>introduced in:</dt>
<dd>API Level 1</dd>
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/action-element.html">&lt;action&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/data-element.html">&lt;data&gt;</a></code></dd>