pub struct Activity {
Show 42 fields pub allow_embedded: Option<VarOrBool>, pub allow_task_reparenting: Option<VarOrBool>, pub always_retain_task_state: Option<VarOrBool>, pub auto_remove_from_recents: Option<VarOrBool>, pub banner: Option<Resource<DrawableResource>>, pub clear_task_on_launch: Option<VarOrBool>, pub color_mode: Option<ColorMode>, pub config_changes: AttributeList<VerticalBar, ConfigChanges>, pub direct_boot_aware: Option<VarOrBool>, pub document_launch_mode: Option<DocumentLaunchMode>, pub enabled: Option<VarOrBool>, pub exclude_from_recents: Option<VarOrBool>, pub exported: Option<VarOrBool>, pub finish_on_task_launch: Option<VarOrBool>, pub hardware_accelerated: Option<VarOrBool>, pub icon: Option<MipmapOrDrawableResource>, pub immersive: Option<VarOrBool>, pub label: Option<StringResourceOrString>, pub launch_mode: Option<LaunchMode>, pub lock_task_mode: Option<LockTaskMode>, pub max_recents: Option<u32>, pub max_aspect_ratio: Option<f32>, pub multiprocess: Option<VarOrBool>, pub name: String, pub no_history: Option<VarOrBool>, pub parent_activity_name: Option<String>, pub persistable_mode: Option<PersistableMode>, pub permission: Option<String>, pub process: Option<String>, pub relinquish_task_identity: Option<VarOrBool>, pub resizeable_activity: Option<VarOrBool>, pub screen_orientation: Option<ScreenOrientation>, pub show_for_all_users: Option<VarOrBool>, pub state_not_needed: Option<VarOrBool>, pub supports_picture_in_picture: Option<VarOrBool>, pub task_affinity: Option<String>, pub theme: Option<Resource<StyleResource>>, pub ui_options: Option<UiOptions>, pub window_soft_input_mode: AttributeList<VerticalBar, WindowSoftInputMode>, pub layout: Option<Layout>, pub intent_filter: Vec<IntentFilter>, pub meta_data: Vec<MetaData>,
}
Expand description

Declares an activity (an Activity subclass) that implements part of the application’s visual user interface.

All activities must be represented by <activity> elements in the manifest file. Any that are not declared there will not be seen by the system and will never be run.

XML Syntax

<activity android:allowEmbedded=["true" | "false"]
          android:allowTaskReparenting=["true" | "false"]
          android:alwaysRetainTaskState=["true" | "false"]
          android:autoRemoveFromRecents=["true" | "false"]
          android:banner="drawable resource"
          android:clearTaskOnLaunch=["true" | "false"]
          android:colorMode=["hdr" | "wideColorGamut"]
          android:configChanges=["mcc", "mnc", "locale",
                                 "touchscreen", "keyboard", "keyboardHidden",
                                 "navigation", "screenLayout", "fontScale",
                                 "uiMode", "orientation", "density",
                                 "screenSize", "smallestScreenSize"]
          android:directBootAware=["true" | "false"]
          android:documentLaunchMode=["intoExisting" | "always" |
                                      "none" | "never"]
          android:enabled=["true" | "false"]
          android:excludeFromRecents=["true" | "false"]
          android:exported=["true" | "false"]
          android:finishOnTaskLaunch=["true" | "false"]
          android:hardwareAccelerated=["true" | "false"]
          android:icon="drawable resource"
          android:immersive=["true" | "false"]
          android:label="string resource"
          android:launchMode=["standard" | "singleTop"|
                              "singleTask" | "singleInstance"]
          android:lockTaskMode=["normal" | "never" |
                                "if_whitelisted" | "always"]
          android:maxRecents="integer"
          android:maxAspectRatio="float"
          android:multiprocess=["true" | "false"]
          android:name="string"
          android:noHistory=["true" | "false"]
          android:parentActivityName="string"
          android:persistableMode=["persistRootOnly" |
                                   "persistAcrossReboots" | "persistNever"]
          android:permission="string"
          android:process="string"
          android:relinquishTaskIdentity=["true" | "false"]
          android:resizeableActivity=["true" | "false"]
          android:screenOrientation=["unspecified" | "behind" |
                                     "landscape" | "portrait" |
                                     "reverseLandscape" | "reversePortrait" |
                                     "sensorLandscape" | "sensorPortrait" |
                                     "userLandscape" | "userPortrait" |
                                     "sensor" | "fullSensor"|"nosensor" |
                                     "user" | "fullUser" | "locked"]
          android:showForAllUsers=["true" | "false"]
          android:stateNotNeeded=["true" | "false"]
          android:supportsPictureInPicture=["true" | "false"]
          android:taskAffinity="string"
          android:theme="resource or theme"
          android:uiOptions=["none" | "splitActionBarWhenNarrow"]
          android:windowSoftInputMode=["stateUnspecified",
                                       "stateUnchanged", "stateHidden",
                                       "stateAlwaysHidden", "stateVisible",
                                       "stateAlwaysVisible", "adjustUnspecified",
                                       "adjustResize", "adjustPan"] >
    ...
</activity>

Contained in

Can contain

Introduced in

API Level 1 for all attributes except for noHistory and windowSoftInputMode, which were added in API Level 3.

Fields§

§allow_embedded: Option<VarOrBool>

Indicate that the activity can be launched as the embedded child of another activity. Particularly in the case where the child lives in a container such as a Display owned by another activity. For example, activities that are used for Wear custom notifications must declare this so Wear can display the activity in it’s context stream, which resides in another process. The default value of this attribute is “false”.

§allow_task_reparenting: Option<VarOrBool>

Whether or not the activity can move from the task that started it to the task it has an affinity for when that task is next brought to the front — “true” if it can move, and “false” if it must remain with the task where it started.

If this attribute is not set, the value set by the corresponding allowTaskReparenting attribute of the <application> element applies to the activity. The default value is “false”.

Normally when an activity is started, it’s associated with the task of the activity that started it and it stays there for its entire lifetime. You can use this attribute to force it to be re-parented to the task it has an affinity for when its current task is no longer displayed. Typically, it’s used to cause the activities of an application to move to the main task associated with that application.

For example, if an e-mail message contains a link to a web page, clicking the link brings up an activity that can display the page. That activity is defined by the browser application, but is launched as part of the e-mail task. If it’s reparented to the browser task, it will be shown when the browser next comes to the front, and will be absent when the e-mail task again comes forward.

The affinity of an activity is defined by the taskAffinity attribute. The affinity of a task is determined by reading the affinity of its root activity. Therefore, by definition, a root activity is always in a task with the same affinity. Since activities with “singleTask” or “singleInstance” launch modes can only be at the root of a task, re-parenting is limited to the “standard” and “singleTop” modes. (See also the launchMode attribute.)

§always_retain_task_state: Option<VarOrBool>

Whether or not the state of the task that the activity is in will always be maintained by the system — “true” if it will be, and “false” if the system is allowed to reset the task to its initial state in certain situations. The default value is “false”. This attribute is meaningful only for the root activity of a task; it’s ignored for all other activities.

Normally, the system clears a task (removes all activities from the stack above the root activity) in certain situations when the user re-selects that task from the home screen. Typically, this is done if the user hasn’t visited the task for a certain amount of time, such as 30 minutes.

However, when this attribute is “true”, users will always return to the task in its last state, regardless of how they get there. This is useful, for example, in an application like the web browser where there is a lot of state (such as multiple open tabs) that users would not like to lose.

§auto_remove_from_recents: Option<VarOrBool>

Whether or not tasks launched by activities with this attribute remains in the overview screen until the last activity in the task is completed. If true, the task is automatically removed from the overview screen. This overrides the caller’s use of FLAG_ACTIVITY_RETAIN_IN_RECENTS. It must be a boolean value, either “true” or “false”.

§banner: Option<Resource<DrawableResource>>

A drawable resource providing an extended graphical banner for its associated item. Use with the <activity> tag to supply a default banner for a specific activity, or with the <application> tag to supply a banner for all application activities.

The system uses the banner to represent an app in the Android TV home screen. Since the banner is displayed only in the home screen, it should only be specified by applications with an activity that handles the CATEGORY_LEANBACK_LAUNCHER intent.

This attribute must be set as a reference to a drawable resource containing the image (for example “@drawable/banner”). There is no default banner.

See Provide a home screen banner in Get Started with TV Apps for more information.

§clear_task_on_launch: Option<VarOrBool>

Whether or not all activities will be removed from the task, except for the root activity, whenever it is re-launched from the home screen — “true” if the task is always stripped down to its root activity, and “false” if not. The default value is “false”. This attribute is meaningful only for activities that start a new task (the root activity); it’s ignored for all other activities in the task.

When the value is “true”, every time users start the task again, they are brought to its root activity regardless of what they were last doing in the task and regardless of whether they used the Back or Home button to leave it. When the value is “false”, the task may be cleared of activities in some situations (see the alwaysRetainTaskState attribute), but not always.

Suppose, for example, that someone launches activity P from the home screen, and from there goes to activity Q. The user next presses Home, and then returns to activity P. Normally, the user would see activity Q, since that is what they were last doing in P’s task. However, if P set this flag to “true”, all of the activities on top of it (Q in this case) would be removed when the user launched activity P from the home screen. So the user would see only P when returning to the task.

If this attribute and allowTaskReparenting are both “true”, any activities that can be re-parented are moved to the task they share an affinity with; the remaining activities are then dropped, as described above.

This attribute is ignored if FLAG_ACTIVITY_RESET_TASK_IF_NEEDED is not set.

§color_mode: Option<ColorMode>

Requests the activity to be displayed in wide color gamut mode on compatible devices. In wide color gamut mode, a window can render outside of the SRGB gamut to display more vibrant colors. If the device doesn’t support wide color gamut rendering, this attribute has no effect. For more information about rendering in wide color mode, see Enhancing Graphics with Wide Color Content.

§config_changes: AttributeList<VerticalBar, ConfigChanges>

Lists configuration changes that the activity will handle itself. When a configuration change occurs at runtime, the activity is shut down and restarted by default, but declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and its onConfigurationChanged() method is called.

Any or all of the following strings are valid values for this attribute. Multiple values are separated by ‘|’ — for example: “locale|navigation|orientation”.

Note

Using this attribute should be avoided and used only as a last resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change.

§direct_boot_aware: Option<VarOrBool>

Whether or not the activity is direct-boot aware; that is, whether or not it can run before the user unlocks the device.

The default value is “false”.

Note

During Direct Boot, an activity in your application can only access the data that is stored in device protected storage.

§document_launch_mode: Option<DocumentLaunchMode>

Specifies how a new instance of an activity should be added to a task each time it is launched. This attribute permits the user to have multiple documents from the same application appear in the overview screen.

Note

For values other than “none” and “never” the activity must be defined with launchMode=“standard”. If this attribute is not specified, documentLaunchMode=“none” is used.

§enabled: Option<VarOrBool>

Whether or not the activity can be instantiated by the system — “true” if it can be, and “false” if not.

The default value is “true”.

The <application> element has its own enabled attribute that applies to all application components, including activities. The <application> and <activity> attributes must both be “true” (as they both are by default) for the system to be able to instantiate the activity. If either is “false”, it cannot be instantiated.

§exclude_from_recents: Option<VarOrBool>

Whether or not the task initiated by this activity should be excluded from the list of recently used applications, the overview screen. That is, when this activity is the root activity of a new task, this attribute determines whether the task should not appear in the list of recent apps. Set “true” if the task should be excluded from the list; set “false” if it should be included.

The default value is “false”.

§exported: Option<VarOrBool>

This element sets whether the activity can be launched by components of other applications — “true” if it can be, and “false” if not. If “false”, the activity can be launched only by components of the same application or applications with the same user ID.

If you are using intent filters, you should not set this element “false”. If you do so, and an app tries to call the activity, system throws an ActivityNotFoundException. Instead, you should prevent other apps from calling the activity by not setting intent filters for it.

If you do not have intent filters, the default value for this element is “false”. If you set the element “true”, the activity is accessible to any app that knows its exact class name, but does not resolve when the system tries to match an implicit intent.

This attribute is not the only way to limit an activity’s exposure to other applications. You can also use a permission to limit the external entities that can invoke the activity (see the permission attribute).

§finish_on_task_launch: Option<VarOrBool>

Whether or not an existing instance of the activity should be shut down (finished) whenever the user again launches its task (chooses the task on the home screen) — “true” if it should be shut down, and “false” if not.

The default value is “false”.

If this attribute and allowTaskReparenting are both “true”, this attribute trumps the other. The affinity of the activity is ignored. The activity is not re-parented, but destroyed.

§hardware_accelerated: Option<VarOrBool>

Whether or not hardware-accelerated rendering should be enabled for this Activity — “true” if it should be enabled, and “false” if not.

The default value is “false”.

Starting from Android 3.0, a hardware-accelerated OpenGL renderer is available to applications, to improve performance for many common 2D graphics operations. When the hardware-accelerated renderer is enabled, most operations in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated.This results in smoother animations, smoother scrolling, and improved responsiveness overall, even for applications that do not explicitly make use the framework’s OpenGL libraries. Because of the increased resources required to enable hardware acceleration, your app will consume more RAM.

Note that not all of the OpenGL 2D operations are accelerated. If you enable the hardware-accelerated renderer, test your application to ensure that it can make use of the renderer without errors.

§icon: Option<MipmapOrDrawableResource>

An icon representing the activity. The icon is displayed to users when a representation of the activity is required on-screen. For example, icons for activities that initiate tasks are displayed in the launcher window. The icon is often accompanied by a label (see the android:label attribute).

This attribute must be set as a reference to a drawable resource containing the image definition. If it is not set, the icon specified for the application as a whole is used instead (see the <application> element’s icon attribute).

The activity’s icon — whether set here or by the <application> element — is also the default icon for all the activity’s intent filters (see the <intent-filter> element’s icon attribute).

§immersive: Option<VarOrBool>

Sets the immersive mode setting for the current activity. If the android:immersive attribute is set to true in the app’s manifest entry for this activity, the ActivityInfo.flags member always has its FLAG_IMMERSIVE bit set, even if the immersive mode is changed at runtime using the setImmersive() method.

§label: Option<StringResourceOrString>

A user-readable label for the activity. The label is displayed on-screen when the activity must be represented to the user. It’s often displayed along with the activity icon. If this attribute is not set, the label set for the application as a whole is used instead (see the <application> element’s label attribute).

The activity’s label — whether set here or by the <application> element — is also the default label for all the activity’s intent filters (see the <intent-filter> element’s label attribute).

The label should be set as a reference to a string resource, so that it can be localized like other strings in the user interface. However, as a convenience while you’re developing the application, it can also be set as a raw string.

§launch_mode: Option<LaunchMode>

An instruction on how the activity should be launched. There are four modes that work in conjunction with activity flags (FLAG_ACTIVITY_* constants) in Intent objects to determine what should happen when the activity is called upon to handle an intent.

The default mode is "standard".

§lock_task_mode: Option<LockTaskMode>

Determines how the system presents this activity when the device is running in lock task mode.

Android can run tasks in an immersive, kiosk-like fashion called lock task mode. When the system runs in lock task mode, device users typically can’t see notifications, access non-allowlisted apps, or return to the home screen (unless the Home app is allowlisted). Only apps that have been allowlisted by a device policy controller (DPC) can run when the system is in lock task mode. System and privileged apps, however, can run in lock task mode without being allowlisted.

This attribute was introduced in API Level 23.

§max_recents: Option<u32>

The maximum number of tasks rooted at this activity in the overview screen. When this number of entries is reached, the system removes the least-recently used instance from the overview screen. Valid values are 1 through 50 (25 on low memory devices); zero is invalid. This must be an integer value, such as 50.

The default value is 16.

§max_aspect_ratio: Option<f32>

The maximum aspect ratio the activity supports. If the app runs on a device with a wider aspect ratio, the system automatically letterboxes the app, leaving portions of the screen unused so the app can run at its specified maximum aspect ratio. Maximum aspect ratio is expressed as the decimal form of the quotient of the device’s longer dimension divided by its shorter dimension. For example, if the maximum aspect ratio is 7:3, set the value of this attribute to 2.33. On non-wearable devices, the value of this attribute needs to be 1.33 or greater. On wearable devices, it must be 1.0 or greater. Otherwise, the system ignores the set value.

Note

This attribute is ignored if the activity has resizeableActivity set to true, since that means your activity supports any size.

For more information about this attribute, see Supporting Multiple Screens.

§multiprocess: Option<VarOrBool>

Whether an instance of the activity can be launched into the process of the component that started it — “true” if it can be, and “false” if not.

The default value is “false”.

Normally, a new instance of an activity is launched into the process of the application that defined it, so all instances of the activity run in the same process. However, if this flag is set to “true”, instances of the activity can run in multiple processes, allowing the system to create instances wherever they are used (provided permissions allow it), something that is almost never necessary or desirable.

§name: String

The name of the class that implements the activity, a subclass of Activity. The attribute value should be a fully qualified class name (such as, “com. example.project.ExtracurricularActivity”). However, as a shorthand, if the first character of the name is a period (for example, “. ExtracurricularActivity”), it is appended to the package name specified in the <manifest> element.

Once you publish your application, you should not change this name (unless you’ve set android:exported=“false”).

There is no default. The name must be specified.

§no_history: Option<VarOrBool>

Whether or not the activity should be removed from the activity stack and finished (its finish() method called) when the user navigates away from it and it’s no longer visible on screen — “true” if it should be finished, and “false” if not.

The default value is “false”.

A value of “true” means that the activity will not leave a historical trace. It will not remain in the activity stack for the task, so the user will not be able to return to it. In this case, onActivityResult() is never called if you start another activity for a result from this activity.

This attribute was introduced in API Level 3.

§parent_activity_name: Option<String>

The class name of the logical parent of the activity. The name here must match the class name given to the corresponding <activity> element’s android:name attribute.

The system reads this attribute to determine which activity should be started when the user presses the Up button in the action bar. The system can also use this information to synthesize a back stack of activities with TaskStackBuilder.

To support API levels 4 - 16, you can also declare the parent activity with a <meta-data> element that specifies a value for "android.support.PARENT_ACTIVITY".

For more information about declaring the parent activity to support Up navigation, read Providing Up Navigation.

This attribute was introduced in API Level 16.

XML Examples

To support API levels 4 - 16:

<activity android:name="com.example.app.ChildActivity"
          android:label="@string/title_child_activity"
          android:parentActivityName="com.example.app.MainActivity" >
     <!-- Parent activity meta-data to support API level 4+ -->
     <meta-data android:name="android.support.PARENT_ACTIVITY"
                android:value="com.example.app.MainActivity" />
</activity>
§persistable_mode: Option<PersistableMode>

Defines how an instance of an activity is preserved within a containing task across device restarts.

If the root activity of a task sets this attribute’s value to persistRootOnly, then only the root activity is preserved. Otherwise, the activities that are higher up the task’s back stack are examined; any of these activities that set this attribute’s value to persistAcrossReboots are preserved.

This attribute was introduced in API level 21.

§permission: Option<String>

The name of a permission that clients must have to launch the activity or otherwise get it to respond to an intent. If a caller of startActivity() or startActivityForResult() has not been granted the specified permission, its intent will not be delivered to the activity.

If this attribute is not set, the permission set by the <application> element’s permission attribute applies to the activity. If neither attribute is set, the activity is not protected by a permission.

For more information on permissions, see the Permissions section in the introduction and another document, Security and Permissions.

§process: Option<String>

The name of the process in which the activity should run. Normally, all components of an application run in a default process name created for the application and you do not need to use this attribute. But if necessary, you can override the default process name with this attribute, allowing you to spread your app components across multiple processes.

If the name assigned to this attribute begins with a colon (‘:’), a new process, private to the application, is created when it’s needed and the activity runs in that process. If the process name begins with a lowercase character, the activity will run in a global process of that name, provided that it has permission to do so. This allows components in different applications to share a process, reducing resource usage.

The <application> element’s process attribute can set a different default process name for all components.

§relinquish_task_identity: Option<VarOrBool>

Whether or not the activity relinquishes its task identifiers to an activity above it in the task stack. A task whose root activity has this attribute set to “true” replaces the base Intent with that of the next activity in the task. If the next activity also has this attribute set to “true” then it will yield the base Intent to any activity that it launches in the same task. This continues for each activity until an activity is encountered which has this attribute set to “false”.

The default value is “false”.

This attribute set to “true” also permits the activity’s use of the ActivityManager.TaskDescription to change labels, colors and icons in the overview screen.

§resizeable_activity: Option<VarOrBool>

Specifies whether the app supports multi-window display. You can set this attribute in either the <activity> or <application> element.

If you set this attribute to true, the user can launch the activity in split-screen and freeform modes. If you set the attribute to false, the activity does not support multi-window mode. If this value is false, and the user attempts to launch the activity in multi-window mode, the activity takes over the full screen.

If your app targets API level 24 or higher, but you do not specify a value for this attribute, the attribute’s value defaults to true.

This attribute was added in API level 24.

Note

A task’s root activity value is applied to all additional activities launched in the task. That is, if the root activity of a task is resizable then the system treats all other activities in the task as resizable. If the root activity is not resizable, the other activities in the task are not resizable.

§screen_orientation: Option<ScreenOrientation>

The orientation of the activity’s display on the device. The system ignores this attribute if the activity is running in multi-window mode.

Note

When you declare one of the landscape or portrait values, it is considered a hard requirement for the orientation in which the activity runs. As such, the value you declare enables filtering by services such as Google Play so your application is available only to devices that support the orientation required by your activities. For example, if you declare either "landscape", "reverseLandscape", or "sensorLandscape", then your application will be available only to devices that support landscape orientation. However, you should also explicitly declare that your application requires either portrait or landscape orientation with the <uses-feature> element.

<uses-feature android:name="android.hardware.screen.portrait"/>.

This is purely a filtering behavior provided by Google Play (and other services that support it) and the platform itself does not control whether your app can be installed when a device supports only certain orientations.

§show_for_all_users: Option<VarOrBool>

Whether or not the activity is shown when the device’s current user is different than the user who launched the activity. You can set this attribute to a literal value — “true” or “false” — or you can set the attribute to a resource or theme attribute that contains a boolean value.

This attribute was added in API level 23.

§state_not_needed: Option<VarOrBool>

Whether or not the activity can be killed and successfully restarted without having saved its state — “true” if it can be restarted without reference to its previous state, and “false” if its previous state is required. The default value is “false”.

Normally, before an activity is temporarily shut down to save resources, its onSaveInstanceState() method is called. This method stores the current state of the activity in a Bundle object, which is then passed to onCreate() when the activity is restarted. If this attribute is set to “true”, onSaveInstanceState() may not be called and onCreate() will be passed null instead of the Bundle — just as it was when the activity started for the first time.

A “true” setting ensures that the activity can be restarted in the absence of retained state. For example, the activity that displays the home screen uses this setting to make sure that it does not get removed if it crashes for some reason.

§supports_picture_in_picture: Option<VarOrBool>

Specifies whether the activity supports Picture-in-Picture display.

This attribute was added in API level 24.

§task_affinity: Option<String>

The task that the activity has an affinity for. Activities with the same affinity conceptually belong to the same task (to the same "application" from the user’s perspective). The affinity of a task is determined by the affinity of its root activity.

The affinity determines two things — the task that the activity is re-parented to (see the allowTaskReparenting attribute) and the task that will house the activity when it is launched with the FLAG_ACTIVITY_NEW_TASK flag.

By default, all activities in an application have the same affinity. You can set this attribute to group them differently, and even place activities defined in different applications within the same task. To specify that the activity does not have an affinity for any task, set it to an empty string.

If this attribute is not set, the activity inherits the affinity set for the application (see the <application> element’s taskAffinity attribute). The name of the default affinity for an application is the package name set by the <manifest> element.

§theme: Option<Resource<StyleResource>>

A reference to a style resource defining an overall theme for the activity. This automatically sets the activity’s context to use this theme (see setTheme() and may also cause “starting” animations prior to the activity being launched (to better match what the activity actually looks like).

If this attribute is not set, the activity inherits the theme set for the application as a whole — from the <application> element’s theme attribute. If that attribute is also not set, the default system theme is used.

For more information, see the Styles and Themes developer guide.

§ui_options: Option<UiOptions>

Extra options for an activity’s UI.

For more information about the app bar, see the Adding the App Bar training class.

This attribute was added in API level 14.

§window_soft_input_mode: AttributeList<VerticalBar, WindowSoftInputMode>

How the main window of the activity interacts with the window containing the on-screen soft keyboard. The setting for this attribute affects two things:

  • The state of the soft keyboard — whether it is hidden or visible — when the activity becomes the focus of user attention.
  • The adjustment made to the activity’s main window — whether it is resized smaller to make room for the soft keyboard or whether its contents pan to make the current focus visible when part of the window is covered by the soft keyboard.

The setting must be one of the values listed in the following table, or a combination of one “state...” value plus one “adjust...” value. Setting multiple values in either group — multiple “state...” values, for example — has undefined results. Individual values are separated by a vertical bar (|).

XML Examples

<activity android:windowSoftInputMode="stateVisible|adjustResize" ... >

Values set here (other than “stateUnspecified” and “adjustUnspecified”) override values set in the theme.

§layout: Option<Layout>

A <layout> tag.

§intent_filter: Vec<IntentFilter>

List of <intent-filter> tags.

§meta_data: Vec<MetaData>

List of <meta-data> tags.

Trait Implementations§

source§

impl Clone for Activity

source§

fn clone(&self) -> Activity

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Activity

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Activity

source§

fn default() -> Activity

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Activity

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<Activity> for Activity

source§

fn eq(&self, other: &Activity) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Activity

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl YaDeserialize for Activity

source§

fn deserialize<R: Read>(reader: &mut Deserializer<R>) -> Result<Self, String>

source§

impl YaSerialize for Activity

source§

fn serialize<W: Write>(&self, writer: &mut Serializer<W>) -> Result<(), String>

source§

fn serialize_attributes( &self, source_attributes: Vec<OwnedAttribute>, source_namespace: Namespace ) -> Result<(Vec<OwnedAttribute>, Namespace), String>

source§

impl StructuralPartialEq for Activity

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,