1page.title=<activity>
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;activity android:<a href="#embedded">allowEmbedded</a>=["true" | "false"]
9          android:<a href="#reparent">allowTaskReparenting</a>=["true" | "false"]
10          android:<a href="#always">alwaysRetainTaskState</a>=["true" | "false"]
11          android:<a href="#autoremrecents">autoRemoveFromRecents</a>=["true" | "false"]
12          android:<a href="#banner">banner</a>="<i>drawable resource</i>"
13          android:<a href="#clear">clearTaskOnLaunch</a>=["true" | "false"]
14          android:<a href="#config">configChanges</a>=["mcc", "mnc", "locale",
15                                 "touchscreen", "keyboard", "keyboardHidden",
16                                 "navigation", "screenLayout", "fontScale",
17                                 "uiMode", "orientation", "screenSize",
18                                 "smallestScreenSize"]
19          android:<a href="#dlmode">documentLaunchMode</a>=["intoExisting" | "always" |
20                                  "none" | "never"]
21          android:<a href="#enabled">enabled</a>=["true" | "false"]
22          android:<a href="#exclude">excludeFromRecents</a>=["true" | "false"]
23          android:<a href="#exported">exported</a>=["true" | "false"]
24          android:<a href="#finish">finishOnTaskLaunch</a>=["true" | "false"]
25          android:<a href="#hwaccel">hardwareAccelerated</a>=["true" | "false"]
26          android:<a href="#icon">icon</a>="<i>drawable resource</i>"
27          android:<a href="#label">label</a>="<i>string resource</i>"
28          android:<a href="#lmode">launchMode</a>=["multiple" | "singleTop" |
29                              "singleTask" | "singleInstance"]
30          android:<a href="#maxRecents">maxRecents</a>="<i>integer</i>"
31          android:<a href="#multi">multiprocess</a>=["true" | "false"]
32          android:<a href="#nm">name</a>="<i>string</i>"
33          android:<a href="#nohist">noHistory</a>=["true" | "false"]  <!-- ##api level 3## -->
34          android:<a href="#parent">parentActivityName</a>="<i>string</i>" <!-- api level 16 -->
35          android:<a href="#prmsn">permission</a>="<i>string</i>"
36          android:<a href="#proc">process</a>="<i>string</i>"
37          android:<a href="#relinquish">relinquishTaskIdentity</a>=["true" | "false"]
38          android:<a href="#screen">screenOrientation</a>=["unspecified" | "behind" |
39                                     "landscape" | "portrait" |
40                                     "reverseLandscape" | "reversePortrait" |
41                                     "sensorLandscape" | "sensorPortrait" |
42                                     "userLandscape" | "userPortrait" |
43                                     "sensor" | "fullSensor" | "nosensor" |
44                                     "user" | "fullUser" | "locked"]
45          android:<a href="#state">stateNotNeeded</a>=["true" | "false"]
46          android:<a href="#aff">taskAffinity</a>="<i>string</i>"
47          android:<a href="#theme">theme</a>="<i>resource or theme</i>"
48          android:<a href="#uioptions">uiOptions</a>=["none" | "splitActionBarWhenNarrow"]
49          android:<a href="#wsoft">windowSoftInputMode</a>=["stateUnspecified",
50                                       "stateUnchanged", "stateHidden",
51                                       "stateAlwaysHidden", "stateVisible",
52                                       "stateAlwaysVisible", "adjustUnspecified",
53                                       "adjustResize", "adjustPan"] &gt;   <!-- ##api level 3## -->
54    . . .
55&lt;/activity&gt;</pre></dd>
56
57<dt>contained in:</dt>
58<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code></dd>
59
60<dt>can contain:</dt>
61<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code>
62<br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a></code></dd>
63
64<dt>description:</dt>
65<dd itemprop="description">Declares an activity (an {@link android.app.Activity} subclass) that
66implements part of the application's visual user interface.  All activities
67must be represented by {@code &lt;activity&gt;}
68elements in the manifest file.  Any that are not declared there will not be seen
69by the system and will never be run.
70
71<dt>attributes:</dt>
72<dd><dl class="attr">
73<dt><a name="embedded"></a>{@code android:allowEmbedded}</dt>
74<dd>
75    Indicate that the activity can be launched as the embedded child of another
76    activity. Particularly in the case where the child lives in a container
77    such as a Display owned by another activity. For example, activities
78    that are used for Wear custom notifications must declare this so
79    Wear can display the activity in it's context stream, which resides
80    in another process.
81
82    <p>The default value of this attribute is <code>false</code>.
83</dd>
84<dt><a name="reparent"></a>{@code android:allowTaskReparenting}</dt>
85<dd>Whether or not the activity can move from the task that started it to
86the task it has an affinity for when that task is next brought to the
87front &mdash; "{@code true}" if it can move, and "{@code false}" if it
88must remain with the task where it started.
89
90<p>
91If this attribute is not set, the value set by the corresponding
92<code><a href="{@docRoot}guide/topics/manifest/application-element.html#reparent">allowTaskReparenting</a></code>
93attribute of the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element
94applies to the activity.  The default value is "{@code false}".
95</p>
96
97<p>
98Normally when an activity is started, it's associated with the task of
99the activity that started it and it stays there for its entire lifetime.
100You can use this attribute to force it to be re-parented to the task it
101has an affinity for when its current task is no longer displayed.
102Typically, it's used to cause the activities of an application to move
103to the main task associated with that application.
104</p>
105
106<p>
107For example, if an e-mail message contains a link to a web page, clicking
108the link brings up an activity that can display the page.  That activity
109is defined by the browser application, but is launched as part of the e-mail
110task.  If it's reparented to the browser task, it will be shown when the
111browser next comes to the front, and will be absent when the e-mail task
112again comes forward.
113</p>
114
115<p>
116The affinity of an activity is defined by the
117<code><a href="#aff">taskAffinity</a></code> attribute.  The affinity
118of a task is determined by reading the affinity of its root activity.
119Therefore, by definition, a root activity is always in a task with the
120same affinity.  Since activities with "{@code singleTask}" or
121"{@code singleInstance}" launch modes can only be at the root of a task,
122re-parenting is limited to the "{@code standard}" and "{@code singleTop}"
123modes.  (See also the <code><a href="#lmode">launchMode</a></code>
124attribute.)
125</p></dd>
126
127<dt><a name="always"></a>{@code android:alwaysRetainTaskState}</dt>
128<dd>Whether or not the state of the task that the activity is in will always
129be maintained by the system &mdash; "{@code true}" if it will be, and
130"{@code false}" if the system is allowed to reset the task to its initial
131state in certain situations.  The default value is "{@code false}".  This
132attribute is meaningful only for the root activity of a task; it's ignored
133for all other activities.
134
135<p>
136Normally, the system clears a task (removes all activities from the stack
137above the root activity) in certain situations when the user re-selects that
138task from the home screen.  Typically, this is done if the user hasn't visited
139the task for a certain amount of time, such as 30 minutes.
140</p>
141
142<p>
143However, when this attribute is "{@code true}", users will always return
144to the task in its last state, regardless of how they get there.  This is
145useful, for example, in an application like the web browser where there is
146a lot of state (such as multiple open tabs) that users would not like to lose.
147</p></dd>
148
149<dt><a name="autoremrecents"></a>{@code android:autoRemoveFromRecents}</dt>
150<dd>Whether or not tasks launched by activities with this attribute remains in the
151<a href="{@docRoot}guide/components/recents.html">overview screen</a> until the last activity in the
152task is completed. If {@code true}, the task is
153automatically removed from the overview screen. This overrides the caller's use of
154{@link android.content.Intent#FLAG_ACTIVITY_RETAIN_IN_RECENTS}. It must be a boolean value, either
155"{@code true}" or "{@code false}".</dd>
156
157
158<dt><a name="banner"></a>{@code android:banner}</dt>
159<dd>A <a href="{@docRoot}guide/topics/resources/drawable-resource.html">drawable resource</a>
160providing an extended graphical banner for its associated item. Use with the
161{@code &lt;activity&gt;} tag to supply a default banner for a specific activity, or with the
162<a href="{@docRoot}guide/topics/manifest/application-element.html"><code>&lt;application&gt;</code></a>
163tag to supply a banner for all application activities.
164
165<p>The system uses the banner to represent an app in
166the Android TV home screen. Since the banner is displayed only in the home screen, it
167should only be specified by applications with an activity that handles the
168{@link android.content.Intent#CATEGORY_LEANBACK_LAUNCHER} intent.</p>
169
170<p>This attribute must be set as a reference to a drawable resource containing
171the image (for example {@code "&#64;drawable/banner"}). There is no default banner.
172</p>
173
174<p>
175See <a href="{@docRoot}design/tv/patterns.html#banner">
176Banners</a> in the UI Patterns for TV design guide, and <a href="{@docRoot}training/tv/start/start.html#banner">
177Provide a home screen banner</a> in Get Started with TV Apps for more information.
178</p></dd>
179
180
181<dt><a name="clear"></a>{@code android:clearTaskOnLaunch}</dt>
182<dd>Whether or not all activities will be removed from the task, except for
183the root activity, whenever it is re-launched from the home screen &mdash;
184"{@code true}" if the task is always stripped down to its root activity, and
185"{@code false}" if not.  The default value is "{@code false}".  This attribute
186is meaningful only for activities that start a new task (the root activity);
187it's ignored for all other activities in the task.
188
189<p>
190When the value is "{@code true}", every time users start the task again, they
191are brought to its root activity regardless of what they were last doing in
192the task and regardless of whether they used the <em>Back</em> or <em>Home</em> button to
193leave it. When the value is "{@code false}", the task may be cleared of activities in
194some situations (see the
195<code><a href="#always">alwaysRetainTaskState</a></code> attribute), but not always.
196</p>
197
198<p>
199Suppose, for example, that someone launches activity P from the home screen,
200and from there goes to activity Q.  The user next presses <em>Home</em>, and then returns
201to activity P.  Normally, the user would see activity Q, since that is what they
202were last doing in P's task.  However, if P set this flag to "{@code true}", all
203of the activities on top of it (Q in this case) were removed when the user pressed
204<em>Home</em> and the task went to the background.  So the user sees only P when returning
205to the task.
206</p>
207
208<p>
209If this attribute and <code><a href="#reparent">allowTaskReparenting</a></code>
210are both "{@code true}", any activities that can be re-parented are moved to
211the task they share an affinity with; the remaining activities are then dropped,
212as described above.
213</p></dd>
214
215<dt><a name="config"></a>{@code android:configChanges}</dt>
216<dd>Lists configuration changes that the activity will handle itself.  When a configuration
217change occurs at runtime, the activity is shut down and restarted by default, but declaring a
218configuration with this attribute will prevent the activity from being restarted. Instead, the
219activity remains running and its <code>{@link android.app.Activity#onConfigurationChanged(android.content.res.Configuration)
220onConfigurationChanged()}</code> method is called.
221
222<p class="note"><strong>Note:</strong> Using this attribute should be
223avoided and used only as a last resort. Please read <a
224href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime Changes</a> for more
225information about how to properly handle a restart due to a configuration change.</p>
226
227<p>
228Any or all of the following strings are valid values for this attribute. Multiple values are
229separated by '{@code |}' &mdash; for example, "{@code locale|navigation|orientation}".
230</p>
231
232<table>
233<tr>
234   <th>Value</th>
235   <th>Description</th>
236</tr><tr>
237   <td>"{@code mcc}"</td>
238   <td>The IMSI mobile country code (MCC) has changed &mdash;
239       a SIM has been detected and updated the MCC.</td>
240</tr><tr>
241   <td>"{@code mnc}"</td>
242   <td>The IMSI mobile network code (MNC) has changed &mdash;
243       a SIM has been detected and updated the MNC.</td>
244</tr><tr>
245   <td>"{@code locale}"</td>
246   <td>The locale has changed &mdash; the user has selected a new
247       language that text should be displayed in.</td>
248</tr><tr>
249   <td>"{@code touchscreen}"</td>
250   <td>The touchscreen has changed.  (This should never normally happen.)</td>
251</tr><tr>
252   <td>"{@code keyboard}"</td>
253   <td>The keyboard type has changed &mdash; for example, the user has
254       plugged in an external keyboard.</td>
255</tr><tr>
256   <td>"{@code keyboardHidden}"</td>
257   <td>The keyboard accessibility has changed &mdash; for example, the
258       user has revealed the hardware keyboard.</td>
259</tr><tr>
260   <td>"{@code navigation}"</td>
261   <td>The navigation type (trackball/dpad) has changed.  (This should never normally happen.)</td>
262</tr><tr>
263   <td>"{@code screenLayout}"</td>
264   <td>The screen layout has changed &mdash; this might be caused by a
265             different display being activated.</td>
266 </tr><tr>
267  <td>"{@code fontScale}"</td>
268   <td>The font scaling factor has changed &mdash; the user has selected
269       a new global font size.</td>
270  </tr><tr>
271  <td>"{@code uiMode}"</td>
272   <td>The user interface mode has changed &mdash; this can be caused when the user places the
273device into a desk/car dock or when the night mode changes. See {@link
274android.app.UiModeManager}.
275    <em>Added in API level 8</em>.</td>
276  </tr><tr>
277   <td>"{@code orientation}"</td>
278   <td>The screen orientation has changed &mdash; the user has rotated the device.
279       <p class="note"><strong>Note:</strong> If your application targets API level 13 or higher (as
280declared by the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
281minSdkVersion}</a> and <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
282targetSdkVersion}</a> attributes), then you should also declare the {@code "screenSize"}
283configuration, because it also changes when a device switches between portrait and landscape
284orientations.</p></td>
285 </tr><tr>
286   <td>"{@code screenSize}"</td>
287   <td>The current available screen size has changed. This represents a change in the currently
288available size, relative to the current aspect ratio, so will change when the user switches between
289landscape and portrait. However, if your application targets API level 12 or lower, then your
290activity always handles this configuration change itself (this configuration change does not restart
291your activity, even when running on an Android 3.2 or higher device).
292  <p><em>Added in API level 13.</em></p></td>
293 </tr><tr>
294   <td>"{@code smallestScreenSize}"</td>
295   <td>The physical screen size has changed. This represents a change in size regardless of
296orientation, so will only change when the actual physical screen size has changed such as switching
297to an external display. A change to this configuration corresponds to a change in the <a
298href="{@docRoot}guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">
299smallestWidth configuration</a>. However, if your application targets API level 12 or lower, then
300your activity always handles this configuration change itself (this configuration change does not
301restart your activity, even when running on an Android 3.2 or higher device).
302  <p><em>Added in API level 13.</em></p></td>
303 </tr><tr>
304  <td>"{@code layoutDirection}"</td>
305   <td>The layout direction has changed. For example, changing from left-to-right (LTR)
306    to right-to-left (RTL).
307   <em>Added in API level 17.</em></td>
308  </tr>
309</table>
310
311<p>
312All of these configuration changes can impact the resource values seen by the
313application.  Therefore, when <code>{@link android.app.Activity#onConfigurationChanged(android.content.res.Configuration)
314onConfigurationChanged()}</code> is called, it will generally be necessary to again
315retrieve all resources (including view layouts, drawables, and so on) to correctly
316handle the change.
317</p></dd>
318
319<dt><a name="dlmode"></a>{@code android:documentLaunchMode}</dt>
320<dd>Specifies how a new instance of an activity should be added to a task each time it is
321launched. This attribute permits the user to have multiple documents from the same application
322appear in the <a href="{@docRoot}guide/components/recents.html">overview screen</a>.
323
324<p>This attribute has four values which produce the following effects when the user opens a document
325with the application:</p>
326
327<table>
328<tr>
329  <th>Value</th>
330  <th>Description</th>
331</tr><tr>
332  <td>"{@code intoExisting}"</td>
333  <td>The activity reuses the existing task for the document. Using this value is the same as setting
334  the {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT} flag, <em>without</em> setting the
335  {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK} flag, as described in
336  <a href="{@docRoot}guide/components/recents.html#flag-new-doc">Using the Intent flag to add a task
337  </a>.</td>
338</tr><tr>
339    <td>"{@code always}"</td>
340    <td>The activity creates a new task for the document, even if the document is already opened.
341    This is the same as setting both the {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT}
342    and {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK} flags.</td>
343</tr><tr>
344    <td>"{@code none}"</td>
345    <td>The activity does not create a new task for the activity. This is the default value, which
346    creates a new task only when {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK} is set.
347    The overview screen treats the activity as it would by default: it displays a single task for
348    the app, which resumes from whatever activity the user last invoked.</td>
349</tr><tr>
350    <td>"{@code never}"</td>
351    <td>This activity is not launched into a new document even if the Intent contains
352    {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT}. Setting this overrides the behavior
353    of the {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT} and
354    {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK} flags, if either of these are set in
355    the activity, and the overview screen displays a single task for the app, which resumes from
356    whatever activity the user last invoked.</td>
357</tr>
358</table>
359
360<p class="note"><strong>Note:</strong> For values other than "{@code none}" and "{@code never}" the
361activity must be defined with {@code launchMode="standard"}. If this attribute is not specified,
362{@code documentLaunchMode="none"} is used.</p>
363</dd>
364
365<dt><a name="enabled"></a>{@code android:enabled}</dt>
366<dd>Whether or not the activity can be instantiated by the system &mdash;
367{@code "true"} if it can be, and "{@code false}" if not.  The default value
368is "{@code true}".
369
370<p>
371The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a>
372</code> element has its own<code>
373<a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code>
374attribute that applies to all application components, including activities.  The
375<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
376and {@code &lt;activity&gt;} attributes must both be "{@code true}" (as they both
377are by default) for the system to be able to instantiate the activity.  If either
378is "{@code false}", it cannot be instantiated.
379</p></dd>
380
381<dt><a name="exclude"></a>{@code android:excludeFromRecents}</dt>
382<dd>Whether or not the task initiated by this activity should be excluded from the list of recently
383used applications, the <a href="{@docRoot}guide/components/recents.html">
384overview screen</a>. That is, when this activity is the root activity of a new
385task, this attribute determines whether the task should not appear in the list of recent apps. Set
386"{@code true}" if the task should be <em>excluded</em> from the list; set "{@code false}" if it
387should be <em>included</em>. The default value is "{@code false}".
388</p></dd>
389
390<dt><a name="exported"></a>{@code android:exported}</dt>
391<dd>Whether or not the activity can be launched by components of other
392applications &mdash; "{@code true}" if it can be, and "{@code false}" if not.
393If "{@code false}", the activity can be launched only by components of the
394same application or applications with the same user ID.
395
396<p>
397The default value depends on whether the activity contains intent filters.  The
398absence of any filters means that the activity can be invoked only by specifying
399its exact class name.  This implies that the activity is intended only for
400application-internal use (since others would not know the class name).  So in
401this case, the default value is "{@code false}".
402On the other hand, the presence of at least one filter implies that the activity
403is intended for external use, so the default value is "{@code true}".
404</p>
405
406<p>
407This attribute is not the only way to limit an activity's exposure to other
408applications.  You can also use a permission to limit the external entities that
409can invoke the activity  (see the
410<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#prmsn">permission</a></code>
411attribute).
412</p></dd>
413
414<dt><a name="finish"></a>{@code android:finishOnTaskLaunch}</dt>
415<dd>Whether or not an existing instance of the activity should be shut down
416(finished) whenever the user again launches its task (chooses the task on the
417home screen) &mdash; "{@code true}" if it should be shut down, and "{@code false}"
418if not. The default value is "{@code false}".
419
420<p>
421If this attribute and
422<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
423are both "{@code true}", this attribute trumps the other.  The affinity of the
424activity is ignored.  The activity is not re-parented, but destroyed.
425</p>
426
427<dt><a name="hwaccel"></a>{@code android:hardwareAccelerated}</dt>
428<dd>Whether or not hardware-accelerated rendering should be enabled for this
429Activity &mdash; "{@code true}" if it should be enabled, and "{@code false}" if
430not. The default value is "{@code false}".
431
432
433<p>Starting from Android 3.0, a hardware-accelerated OpenGL renderer is
434available to applications, to improve performance for many common 2D graphics
435operations. When the hardware-accelerated renderer is enabled, most operations
436in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated.
437This results in smoother animations, smoother scrolling, and improved
438responsiveness overall, even for applications that do not explicitly make use
439the framework's OpenGL libraries. Because of the increased resources required to
440enable hardware acceleration, your app will consume more RAM.</p>
441
442<p>Note that not all of the OpenGL 2D operations are accelerated. If you enable
443the hardware-accelerated renderer, test your application to ensure that it can
444make use of the renderer without errors.</p>
445</dd>
446
447<dt><a name="icon"></a>{@code android:icon}</dt>
448<dd>An icon representing the activity. The icon is displayed to users when
449a representation of the activity is required on-screen.  For example, icons
450for activities that initiate tasks are displayed in the launcher window.
451The icon is often accompanied by a label (see the <a href="#label">{@code
452android:label}</a> attribute).
453</p>
454
455<p>
456This attribute must be set as a reference to a drawable resource containing
457the image definition.  If it is not set, the icon specified for the application
458as a whole is used instead (see the
459<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
460element's <code><a href="{@docRoot}guide/topics/manifest/application-element.html#icon">icon</a></code> attribute).
461</p>
462
463<p>
464The activity's icon &mdash; whether set here or by the
465<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
466element &mdash; is also the default icon for all the activity's intent filters (see the
467<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code> element's
468<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#icon">icon</a></code> attribute).
469</p></dd>
470
471<dt><a name="label"></a>{@code android:label}</dt>
472<dd>A user-readable label for the activity.  The label is displayed on-screen
473when the activity must be represented to the user. It's often displayed along
474with the activity icon.
475
476<p>
477If this attribute is not set, the label set for the application as a whole is
478used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element's
479<code><a href="{@docRoot}guide/topics/manifest/application-element.html#label">label</a></code> attribute).
480</p>
481
482<p>
483The activity's label &mdash; whether set here or by the
484<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element &mdash; is also the
485default label for all the activity's intent filters (see the
486<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code> element's
487<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#label">label</a></code> attribute).
488</p>
489
490<p>
491The label should be set as a reference to a string resource, so that
492it can be localized like other strings in the user interface.
493However, as a convenience while you're developing the application,
494it can also be set as a raw string.
495</p></dd>
496
497<dt><a name="lmode"></a>{@code android:launchMode}</dt>
498<dd>An instruction on how the activity should be launched.  There are four modes
499that work in conjunction with activity flags ({@code FLAG_ACTIVITY_*} constants)
500in {@link android.content.Intent} objects to determine what should happen when
501the activity is called upon to handle an intent. They are:</p>
502
503<p style="margin-left: 2em">"{@code standard}"
504<br>"{@code singleTop}"
505<br>"{@code singleTask}"
506<br>"{@code singleInstance}"</p>
507
508<p>
509The default mode is "{@code standard}".
510</p>
511
512<p>
513As shown in the table below, the modes fall into two main groups, with
514"{@code standard}" and "{@code singleTop}" activities on one side, and
515"{@code singleTask}" and "{@code singleInstance}" activities on the other.
516An activity with the "{@code standard}" or "{@code singleTop}" launch mode
517can be instantiated multiple times.  The instances can belong to any task
518and can be located anywhere in the activity stack.  Typically, they're
519launched into the task that called
520<code>{@link android.content.Context#startActivity startActivity()}</code>
521(unless the Intent object contains a
522<code>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</code>
523instruction, in which case a different task is chosen &mdash; see the
524<a href="#aff">taskAffinity</a> attribute).
525</p>
526
527<p>
528In contrast, "<code>singleTask</code>" and "<code>singleInstance</code>" activities
529can only begin a task.  They are always at the root of the activity stack.
530Moreover, the device can hold only one instance of the activity at a time
531&mdash; only one such task.
532</p>
533
534<p>
535The "{@code standard}" and "{@code singleTop}" modes differ from each other
536in just one respect:  Every time there's a new intent for a "{@code standard}"
537activity, a new instance of the class is created to respond to that intent.
538Each instance handles a single intent.
539Similarly, a new instance of a "{@code singleTop}" activity may also be
540created to handle a new intent.  However, if the target task already has an
541existing instance of the activity at the top of its stack, that instance
542will receive the new intent (in an
543{@link android.app.Activity#onNewIntent onNewIntent()} call);
544a new instance is not created.
545In other circumstances &mdash; for example, if an existing instance of the
546"{@code singleTop}" activity is in the target task, but not at the top of
547the stack, or if it's at the top of a stack, but not in the target task
548&mdash; a new instance would be created and pushed on the stack.
549</p>
550
551<p>Similarly, if you
552<a href="{@docRoot}training/implementing-navigation/ancestral.html">navigate
553up</a> to an activity on the current stack, the behavior is determined by the
554parent activity's launch mode. If the parent activity has launch mode {@code
555singleTop} (or the <code>up</code> intent contains {@link
556android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}), the parent is brought to the
557top of the stack, and its state is preserved. The navigation intent is received
558by the parent activity's {@link android.app.Activity#onNewIntent onNewIntent()}
559method.  If the parent activity has launch mode {@code standard} (and the
560<code>up</code> intent does not contain {@link
561android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}), the current activity and its
562parent are both popped off the stack, and a new instance of the parent activity
563is created to receive the navigation intent.
564</p>
565
566
567<p>
568The "{@code singleTask}" and "{@code singleInstance}" modes also differ from
569each other in only one respect:  A "{@code singleTask}" activity allows other
570activities to be part of its task. It's always at the root of its task, but
571other activities (necessarily "{@code standard}" and "{@code singleTop}"
572activities) can be launched into that task.  A "{@code singleInstance}"
573activity, on the other hand, permits no other activities to be part of its task.
574It's the only activity in the task.  If it starts another activity, that
575activity is assigned to a different task &mdash; as if {@code
576FLAG_ACTIVITY_NEW_TASK} was in the intent.
577</p>
578
579<table>
580<tr>
581<th>Use Cases</th>
582<th>Launch Mode</th>
583<th>Multiple Instances?</th>
584<th>Comments</th>
585</tr>
586<tr>
587<td rowspan="2" style="width:20%;">Normal launches for most activities</td>
588<td>"<code>standard</code>"</td>
589<td>Yes</td>
590<td>Default. The system always creates a new instance of the activity in the
591target task and routes the intent to it.</td>
592</tr>
593<tr>
594<td>"<code>singleTop</code>"</td>
595<td>Conditionally</td>
596<td>If an instance of the activity already exists at the top of the target task,
597the system routes the intent to that instance through a call to its {@link
598android.app.Activity#onNewIntent onNewIntent()} method, rather than creating a
599new instance of the activity.</td>
600</tr>
601<tr>
602<td rowspan="2">Specialized launches<br>
603<em>(not recommended for general use)</em></td>
604<td>"<code>singleTask</code>"</td>
605<td>No</td>
606<td>The system creates the activity at the root of a new task and routes the
607intent to it. However, if an instance of the activity already exists, the system
608routes the intent to existing instance through a call to its {@link
609android.app.Activity#onNewIntent onNewIntent()} method, rather than creating a
610new one.</td>
611</tr>
612<tr>
613<td>"<code>singleInstance</code>"</td>
614<td>No</td>
615<td>Same as "<code>singleTask"</code>, except that the system doesn't launch any
616other activities into the task holding the instance. The activity is always the
617single and only member of its task.</td>
618</tr>
619</table>
620
621<p>As shown in the table above, <code>standard</code> is the default mode and is
622appropriate for most types of activities. <code>SingleTop</code> is also a
623common and useful launch mode for many types of activities. The other modes
624&mdash; <code>singleTask</code> and <code>singleInstance</code> &mdash; are
625<span style="color:red">not appropriate for most applications</span>,
626since they result in an interaction model that is likely to be unfamiliar to
627users and is very different from most other applications.
628
629<p>Regardless of the launch mode that you choose, make sure to test the usability
630of the activity during launch and when navigating back to it from
631other activities and tasks using the <em>Back</em> button. </p>
632
633<p>For more information on launch modes and their interaction with Intent
634flags, see the
635<a href="{@docRoot}guide/components/tasks-and-back-stack.html">Tasks and Back Stack</a>
636document.
637</p>
638</dd>
639
640<dt><a name="maxrecents"></a>{@code android:maxRecents}</dt>
641<dd>The maximum number of tasks rooted at this activity in the <a href="{@docRoot}guide/components/recents.html">
642overview screen</a>. When this number of entries is reached, the system removes the least-recently
643used instance from the overview screen. Valid values are 1 through 50 (25 on low memory devices);
644zero is invalid. This must be an integer value, such as 50. The default value is 16.
645</dd>
646
647<dt><a name="multi"></a>{@code android:multiprocess}</dt>
648<dd>Whether an instance of the activity can be launched into the process of the component
649that started it &mdash; "{@code true}" if it can be, and "{@code false}" if not.
650The default value is "{@code false}".
651
652<p>
653Normally, a new instance of an activity is launched into the process of the
654application that defined it, so all instances of the activity run in the same
655process.  However, if this flag is set to "{@code true}", instances of the
656activity can run in multiple processes, allowing the system to create instances
657wherever they are used (provided permissions allow it), something that is almost
658never necessary or desirable.
659</p></dd>
660
661<dt><a name="nm"></a>{@code android:name}</dt>
662<dd>The name of the class that implements the activity, a subclass of
663{@link android.app.Activity}.  The attribute value should be a fully qualified
664class name (such as, "{@code com.example.project.ExtracurricularActivity}").
665However, as a shorthand, if the first character of the name is a period
666(for example, "{@code .ExtracurricularActivity}"), it is appended to the
667package name specified in the
668<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
669element.
670<p>Once you publish your application, you <a
671href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">should not
672change this name</a> (unless you've set <code><a
673href="#exported">android:exported</a>="false"</code>).</p>
674
675<p>
676There is no default.  The name must be specified.
677</p></dd>
678
679<!-- ##api level 3## -->
680<dt><a name="nohist"></a>{@code android:noHistory}</dt>
681<dd>Whether or not the activity should be removed from the activity stack and
682finished (its <code>{@link android.app.Activity#finish finish()}</code>
683method called) when the user navigates away from it and it's no longer
684visible on screen &mdash; "{@code true}" if it should be finished, and
685"{@code false}" if not.  The default value is "{@code false}".
686
687<p>
688A value of "{@code true}" means that the activity will not leave a
689historical trace.  It will not remain in the activity stack for the task,
690so the user will not be able to return to it. In this case,
691{@link android.app.Activity#onActivityResult onActivityResult()} is never called if you
692start another activity for a result from this activity.
693</p>
694
695<p>
696This attribute was introduced in API Level 3.
697</p>
698</dd>
699
700<!-- api level 16 -->
701<dt><a name="parent"></a>{@code android:parentActivityName}</dt>
702<dd>The class name of the logical parent of the activity. The name here must match the class
703  name given to the corresponding {@code &lt;activity>} element's
704  <a href="#nm"><code>android:name</code></a> attribute.
705
706<p>The system reads this attribute to determine which activity should be started when
707  the user presses the Up button in the action bar. The system can also use this information to
708  synthesize a back stack of activities with {@link android.app.TaskStackBuilder}.</p>
709
710<p>To support API levels 4 - 16, you can also declare the parent activity with a {@code
711&lt;meta-data>} element that specifies a value for {@code "android.support.PARENT_ACTIVITY"}.
712For example:</p>
713<pre>
714&lt;activity
715    android:name="com.example.app.ChildActivity"
716    android:label="@string/title_child_activity"
717    android:parentActivityName="com.example.myfirstapp.MainActivity" >
718    &lt;!-- Parent activity meta-data to support API level 4+ -->
719    &lt;meta-data
720        android:name="android.support.PARENT_ACTIVITY"
721        android:value="com.example.app.MainActivity" />
722&lt;/activity>
723</pre>
724
725<p>For more information about declaring the parent activity to support Up navigation,
726read <a href="{@docRoot}training/implementing-navigation/ancestral.html">Providing Up
727Navigation</a>.</p>
728
729<p>
730This attribute was introduced in API Level 16.
731</p>
732</dd>
733
734
735
736<dt><a name="prmsn"></a>{@code android:permission}</dt>
737<dd>The name of a permission that clients must have to launch the activity
738or otherwise get it to respond to an intent.  If a caller of
739<code>{@link android.content.Context#startActivity startActivity()}</code> or
740<code>{@link android.app.Activity#startActivityForResult startActivityForResult()}</code>
741has not been granted the specified permission, its intent will not be
742delivered to the activity.
743
744<p>
745If this attribute is not set, the permission set by the
746<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
747element's
748<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code>
749attribute applies to the activity.  If neither attribute is set, the activity is
750not protected by a permission.
751</p>
752
753<p>
754For more information on permissions, see the
755<a href="{@docRoot}guide/topics/manifest/manifest-intro.html#sectperm">Permissions</a>
756section in the introduction and another document,
757<a href="{@docRoot}guide/topics/security/security.html">Security and
758Permissions</a>.
759</p></dd>
760
761<dt><a name="proc"></a>{@code android:process}</dt>
762<dd>The name of the process in which the activity should run. Normally, all components of an
763application run in a default process name created for the application and you do
764not need to use this attribute. But if necessary, you can override the default process
765name with this attribute, allowing you to spread your app components across
766multiple processes.
767
768<p>
769If the name assigned to this attribute begins with a colon (':'), a new
770process, private to the application, is created when it's needed and
771the activity runs in that process.
772If the process name begins with a lowercase character, the activity will run
773in a global process of that name, provided that it has permission to do so.
774This allows components in different applications to share a process, reducing
775resource usage.
776</p>
777
778<p>The <code><a href="{@docRoot}guide/topics/manifest/application-element.html"
779>&lt;application&gt;</a></code> element's
780<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code>
781attribute can set a different default process name for all components.
782</dd>
783
784<dt><a name="relinquish"></a>{@code android:relinquishTaskIdentity}</dt>
785<dd>Whether or not the activity relinquishes its task identifiers to an activity above it in the
786task stack. A task whose root activity has this attribute set to "{@code true}" replaces the base
787Intent with that of the next activity in the task. If the next activity also has this attribute set
788to "{@code true}" then it will yield the base Intent to any activity that it launches in the same
789task. This continues for each activity until an activity is encountered which has this attribute set
790to "{@code false}". The default value is "{@code false}".
791
792<p>This attribute set to "{@code true}" also permits the activity's use of the
793{@link android.app.ActivityManager.TaskDescription} to change labels, colors
794and icons in the <a href="{@docRoot}guide/components/recents.html">overview screen</a>.</p>
795</dd>
796
797
798<dt><a name="screen"></a>{@code android:screenOrientation}</dt>
799<dd>The orientation of the activity's display on the device.
800
801<p>The value can be any one of the following strings:</p>
802
803<table>
804<tr>
805   <td>"{@code unspecified}"</td>
806   <td>The default value.  The system chooses the orientation.  The policy it
807       uses, and therefore the choices made in specific contexts, may differ
808       from device to device.</td>
809</tr><tr>
810   <td>"{@code behind}"</td>
811   <td>The same orientation as the activity that's immediately beneath it in
812       the activity stack.</td>
813</tr><tr>
814   <td>"{@code landscape}"</td>
815   <td>Landscape orientation (the display is wider than it is tall).</td>
816</tr><tr>
817   <td>"{@code portrait}"</td>
818   <td>Portrait orientation (the display is taller than it is wide).</td>
819</tr><tr>
820   <td>"{@code reverseLandscape}"</td>
821   <td>Landscape orientation in the opposite direction from normal landscape.
822<em>Added in API level 9.</em></td>
823</tr><tr>
824   <td>"{@code reversePortrait}"</td>
825   <td>Portrait orientation in the opposite direction from normal portrait.
826<em>Added in API level 9.</em></td>
827</tr><tr>
828   <td>"{@code sensorLandscape}"</td>
829   <td>Landscape orientation, but can be either normal or reverse landscape based on the device
830sensor.
831<em>Added in API level 9.</em></td>
832</tr><tr>
833   <td>"{@code sensorPortrait}"</td>
834   <td>Portrait orientation, but can be either normal or reverse portrait based on the device
835sensor.
836<em>Added in API level 9.</em></td>
837</tr><tr>
838   <td>"{@code userLandscape}"</td>
839   <td>Landscape orientation, but can be either normal or reverse landscape based on the device
840sensor and the user's sensor preference. If the user has locked sensor-based rotation, this behaves
841the same as {@code landscape}, otherwise it behaves the same as {@code sensorLandscape}.
842<em>Added in API level 18.</em></td>
843</tr><tr>
844   <td>"{@code userPortrait}"</td>
845   <td>Portrait orientation, but can be either normal or reverse portrait based on the device
846sensor and the user's sensor preference. If the user has locked sensor-based rotation, this behaves
847the same as {@code portrait}, otherwise it behaves the same as {@code sensorPortrait}.
848<em>Added in API level 18.</em></td>
849</tr><tr>
850   <td>"{@code sensor}"</td>
851   <td>The orientation is determined by the device orientation sensor.  The orientation of the
852display depends on how the user is holding the device; it changes when the user rotates the
853device. Some devices, though, will not rotate to all four possible orientations, by default. To
854allow all four orientations, use {@code "fullSensor"}.</td>
855</tr><tr>
856   <td>"{@code fullSensor}"</td>
857   <td>The orientation is determined by the device orientation sensor for any of the 4 orientations.
858This is similar to {@code "sensor"} except this allows any of the 4 possible screen orientations,
859regardless of what the device will normally do (for example, some devices won't normally use reverse
860portrait or reverse landscape, but this enables those). <em>Added in API level 9.</em></td>
861</tr><tr>
862   <td>"{@code nosensor}"</td>
863   <td>The orientation is determined without reference to a physical orientation sensor.  The sensor
864is ignored, so the display will not rotate based on how the user moves the device.  Except for this
865distinction, the system chooses the orientation using the same policy as for the "{@code
866unspecified}" setting.</td>
867</tr><tr>
868   <td>"{@code user}"</td>
869   <td>The user's current preferred orientation.</td>
870</tr><tr>
871   <td>"{@code fullUser}"</td>
872   <td>If the user has locked sensor-based rotation, this behaves the same as {@code user},
873   otherwise it behaves the same as {@code fullSensor} and allows any of the 4 possible
874   screen orientations.
875    <em>Added in API level 18.</em></td>
876</tr><tr>
877   <td>"{@code locked}"</td>
878   <td>Locks the orientation to its current rotation, whatever that is.
879<em>Added in API level 18.</em></td>
880</tr>
881</table>
882
883<p class="note"><strong>Note:</strong> When you declare one of the landscape or portrait values,
884it is considered a hard requirement for the orientation in which the activity runs. As such,
885the value you declare enables filtering by services such as Google Play so your application is
886available only to devices that support the orientation required by your activities. For
887example, if you declare either {@code "landscape"}, {@code "reverseLandscape"}, or
888{@code "sensorLandscape"}, then your application will be available only to devices that support
889landscape orientation. However, you should also explicitly declare that
890your application requires either portrait or landscape orientation with the <a
891href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code &lt;uses-feature&gt;}</a>
892element. For example, <code>&lt;uses-feature
893android:name="android.hardware.screen.portrait"/></code>. This is purely a filtering behavior
894provided by Google Play (and other services that support it) and the platform itself does not
895control whether your app can be installed when a device supports only certain orientations.</p>
896
897</dd>
898
899<dt><a name="state"></a>{@code android:stateNotNeeded}</dt>
900<dd>Whether or not the activity can be killed and successfully restarted
901without having saved its state &mdash; "{@code true}" if it can be restarted
902without reference to its previous state, and "{@code false}" if its previous
903state is required.  The default value is "{@code false}".
904
905<p>
906Normally, before an activity is temporarily shut down to save resources, its
907<code>{@link android.app.Activity#onSaveInstanceState onSaveInstanceState()}</code>
908method is called.  This method stores the current state of the activity in a
909{@link android.os.Bundle} object, which is then passed to
910<code>{@link android.app.Activity#onCreate onCreate()}</code> when the activity
911is restarted.  If this attribute is set to "{@code true}",
912{@code onSaveInstanceState()} may not be called and {@code onCreate()} will
913be passed {@code null} instead of the Bundle &mdash; just as it was when the
914activity started for the first time.
915</p>
916
917<p>
918A "{@code true}" setting ensures that the activity can be restarted in the
919absence of retained state.  For example, the activity that displays the
920home screen uses this setting to make sure that it does not get removed if it
921crashes for some reason.
922</p></dd>
923
924<dt><a name="aff"></a>{@code android:taskAffinity}</dt>
925<dd>The task that the activity has an affinity for.  Activities with
926the same affinity conceptually belong to the same task (to the same
927"application" from the user's perspective).  The affinity of a task
928is determined by the affinity of its root activity.
929
930<p>
931The affinity determines two things &mdash; the task that the activity is re-parented
932to (see the <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
933attribute) and the task that will house the activity when it is launched
934with the <code>{@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK}</code>
935flag.
936</p>
937
938<p>
939By default, all activities in an application have the same affinity.  You
940can set this attribute to group them differently, and even place
941activities defined in different applications within the same task.  To
942specify that the activity does not have an affinity for any task, set
943it to an empty string.
944
945<p>
946If this attribute is not set, the activity inherits the affinity set
947for the application (see the
948<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
949element's
950<code><a href="{@docRoot}guide/topics/manifest/application-element.html#aff">taskAffinity</a></code>
951attribute).  The name of the default affinity for an application is
952the package name set by the
953<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
954element.
955</p>
956
957<dt><a name="theme"></a>{@code android:theme}</dt>
958<dd>A reference to a style resource defining an overall theme for the activity.
959This automatically sets the activity's context to use this theme (see
960<code>{@link android.content.Context#setTheme setTheme()}</code>, and may also
961cause "starting" animations prior to the activity being launched (to better
962match what the activity actually looks like).
963
964<p>
965If this attribute is not set, the activity inherits the theme set for the
966application as a whole &mdash; from the
967<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
968element's
969<code><a href="{@docRoot}guide/topics/manifest/application-element.html#theme">theme</a></code>
970attribute.  If that attribute is also not set, the default system theme is used. For more
971information, see the <a
972href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a> developer guide.
973</p>
974<dd>
975
976<!-- ##api level 14## -->
977<dt><a name="uioptions"></a>{@code android:uiOptions}</dt>
978<dd>Extra options for an activity's UI.
979  <p>Must be one of the following values.</p>
980
981  <table>
982    <tr><th>Value</th><th>Description</th></tr>
983    <tr><td>{@code "none"}</td><td>No extra UI options. This is the default.</td></tr>
984    <tr><td>{@code "splitActionBarWhenNarrow"}</td><td>Add a bar at
985the bottom of the screen to display action items in the {@link android.app.ActionBar}, when
986constrained for horizontal space (such as when in portrait mode on a handset). Instead of a small
987number of action items appearing in the action bar at the top of the screen, the action bar is
988split into the top navigation section and the bottom bar for action items. This ensures a reasonable
989amount of space is made available not only for the action items, but also for navigation and title
990elements at the top. Menu items are not split across the two bars; they always appear
991together.</td></tr>
992  </table>
993  <p>For more information about the action bar, see the <a
994href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.</p>
995  <p>This attribute was added in API level 14.</p>
996</dd>
997
998
999<!-- ##api level 3## -->
1000<dt><a name="wsoft"></a>{@code android:windowSoftInputMode}</dt>
1001<dd>How the main window of the activity interacts with the window containing
1002the on-screen soft keyboard.  The setting for this attribute affects two
1003things:
1004
1005<ul>
1006<li>The state of the soft keyboard &mdash; whether it is hidden or visible
1007&mdash; when the activity becomes the focus of user attention.</li>
1008
1009<li>The adjustment made to the activity's main window &mdash; whether it is
1010resized smaller to make room for the soft keyboard or whether its contents
1011pan to make the current focus visible when part of the window is covered by
1012the soft keyboard.</li>
1013</ul>
1014
1015<p>
1016The setting must be one of the values listed in the following table, or a
1017combination of one "{@code state...}" value plus one "{@code adjust...}"
1018value.  Setting multiple values in either group &mdash; multiple
1019"{@code state...}" values, for example &mdash; has undefined results.
1020Individual values are separated by a vertical bar ({@code |}).  For example:
1021</p>
1022
1023<pre>&lt;activity android:windowSoftInputMode="stateVisible|adjustResize" . . . &gt;</pre>
1024
1025<p>
1026Values set here (other than "{@code stateUnspecified}" and
1027"{@code adjustUnspecified}") override values set in the theme.
1028</p>
1029
1030<table>
1031<tr>
1032   <th>Value</th>
1033   <th>Description</th>
1034</tr><tr>
1035   <td>"{@code stateUnspecified}"</td>
1036   <td>The state of the soft keyboard (whether it is hidden or visible)
1037       is not specified.  The system will choose an appropriate state or
1038       rely on the setting in the theme.
1039
1040       <p>
1041       This is the default setting for the behavior of the soft keyboard.
1042       </p></td>
1043</tr></tr>
1044   <td>"{@code stateUnchanged}"</td>
1045   <td>The soft keyboard is kept in whatever state it was last in,
1046       whether visible or hidden, when the activity comes to the fore.</td>
1047</tr></tr>
1048   <td>"{@code stateHidden}"</td>
1049   <td>The soft keyboard is hidden when the user chooses the activity
1050       &mdash; that is, when the user affirmatively navigates forward to the
1051       activity, rather than backs into it because of leaving another activity.</td>
1052</tr></tr>
1053   <td>"{@code stateAlwaysHidden}"</td>
1054   <td>The soft keyboard is always hidden when the activity's main window
1055       has input focus.</td>
1056</tr></tr>
1057   <td>"{@code stateVisible}"</td>
1058   <td>The soft keyboard is visible when that's normally appropriate
1059       (when the user is navigating forward to the activity's main window).</td>
1060</tr></tr>
1061   <td>"{@code stateAlwaysVisible}"</td>
1062   <td>The soft keyboard is made visible when the user chooses the
1063       activity &mdash; that is, when the user affirmatively navigates forward
1064       to the activity, rather than backs into it because of leaving another
1065       activity.</td>
1066</tr></tr>
1067   <td>"{@code adjustUnspecified}"</td>
1068   <td>It is unspecified whether the activity's main window resizes
1069       to make room for the soft keyboard, or whether the contents
1070       of the window pan to make the current focus visible on-screen.
1071       The system will automatically select one of these modes depending
1072       on whether the content of the window has any layout views that
1073       can scroll their contents.  If there is such a view, the window
1074       will be resized, on the assumption that scrolling can make all
1075       of the window's contents visible within a smaller area.
1076
1077       <p>
1078       This is the default setting for the behavior of the main window.
1079       </p></td>
1080</tr></tr>
1081   <td>"{@code adjustResize}"</td>
1082   <td>The activity's main window is always resized to make room for
1083       the soft keyboard on screen.</td>
1084</tr></tr>
1085   <td>"{@code adjustPan}"</td>
1086   <td>The activity's main window is not resized to make room for the soft
1087       keyboard.  Rather, the contents of the window are automatically
1088       panned so that the current focus is never obscured by the keyboard
1089       and users can always see what they are typing.  This is generally less
1090       desirable than resizing, because the user may need to close the soft
1091       keyboard to get at and interact with obscured parts of the window.</td>
1092</tr>
1093</table>
1094
1095<p>
1096This attribute was introduced in API Level 3.
1097</p></dd>
1098</dl></dd>
1099
1100<!-- ##api level indication## -->
1101<dt>introduced in:</dt>
1102<dd>API Level 1 for all attributes except for
1103<code><a href="#nohist">noHistory</a></code> and
1104<code><a href="#wsoft">windowSoftInputMode</a></code>, which were added in API
1105Level 3.</dd>
1106
1107<dt>see also:</dt>
1108<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
1109<br/><code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html">&lt;activity-alias&gt;</a></code></dd>
1110</dl>
1111