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