• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=<category>
2parent.title=The AndroidManifest.xml File
3parent.link=manifest-intro.html
4@jd:body
5
6<dl class="xml">
7<dt>syntax:</dt>
8<dd><pre class="stx">&lt;category android:<a href="#nm">name</a>="<i>string</i>" /&gt;</pre></dd>
9
10<dt>contained in:</dt>
11<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code></dd>
12
13<dt>description:</dt>
14<dd itemprop="description">Adds a category name to an intent filter.  See
15<a href="{@docRoot}guide/components/intents-filters.html">Intents and
16Intent Filters</a> for details on intent filters and the role of category
17specifications within a filter.</dd>
18
19<dt>attributes:</dt>
20<dd><dl class="attr">
21<dt><a name="nm"></a>{@code android:name}</dt>
22<dd>The name of the category.  Standard categories are defined in the
23{@link android.content.Intent} class as <code>CATEGORY_<i>name</i></code>
24constants.  The name assigned here can be derived from those constants
25by prefixing "{@code android.intent.category.}" to the
26<code><i>name</i></code> that follows {@code CATEGORY_}.  For example,
27the string value for {@code CATEGORY_LAUNCHER} is
28"{@code android.intent.category.LAUNCHER}".
29
30<p class="note"><strong>Note:</strong> In order to receive implicit intents, you must include the
31{@link android.content.Intent#CATEGORY_DEFAULT} category in the intent filter. The methods
32{@link android.app.Activity#startActivity startActivity()} and
33{@link android.app.Activity#startActivityForResult startActivityForResult()} treat all intents
34as if they declared the {@link android.content.Intent#CATEGORY_DEFAULT} category.
35If you do not declare it in your intent filter, no implicit intents will resolve to
36your activity.</p>
37
38<p>
39Custom categories should use the package name as a prefix, to ensure
40that they are unique.
41</p></dd>
42</dl></dd>
43
44<!-- ##api level indication## -->
45<dt>introduced in:</dt>
46<dd>API Level 1</dd>
47
48<dt>see also:</dt>
49<dd><code><a href="{@docRoot}guide/topics/manifest/action-element.html">&lt;action&gt;</a></code>
50<br/><code><a href="{@docRoot}guide/topics/manifest/data-element.html">&lt;data&gt;</a></code></dd>
51
52</dl>
53