Androidmanifest.xml-"Activity", application, Manifest

Source: Internet
Author: User

<Activityandroid:allowtaskreparenting=["true"| "false"] android:alwaysretaintaskstate=["true"| "false"] android:cleartaskonlaunch=["true"| "false"] android:configchanges=["MCC","MNC", "locale", "touchscreen", "keyboard", "Keyboardhidden", "Navigation", "Screenlayout", "Fontscale", "Uimode", "orientation", "screensize", "Smallestscreensize"] 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:label= "string resource"Android:launchmode=["multiple"| "Singletop" | "Singletask" | "SingleInstance"] android:multiprocess=["true"| "false"] android:name= "string"android:nohistory=["true"| "false"] android:parentactivityname= "string"android:permission= "string"android:process= "string"android:screenorientation=["Unspecified"| "User" |                                     "Behind" | "Landscape" |                                     "Portrait" | "Reverselandscape" |                                     "Reverseportrait" | "Sensorlandscape" |                                     "Sensorportrait" | "Sensor" | "Fullsensor" | "Nosensor"] android:statenotneeded=["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>

Parent element:

<application>

Child elements:

<intent-filter>
<meta-data>

Property:

android:allowTaskReparenting

Whether to allow activity to replace dependent tasks, such as switching from a short message task to a browser task.

android:alwaysRetainTaskState

Whether to keep the state unchanged, such as switching back to home, and then new open, the activity is in the final state

android:clearTaskOnLaunch

For example, p is activity, Q is the activity that is triggered by P, and then returns to home, the new start P, whether to show Q

android:configChanges

Whether the onconfigurationchanged () method such as "Locale|navigation|orientation" is called when the configuration list changes.

Value Description
"mcc" The IMSI Mobile Country Code (MCC) has changed-a SIM have been detected and updated the MCC.
"mnc" The IMSI Mobile Network Code (MNC) has changed-a SIM have been detected and updated the MNC.
"locale" The locale has changed-the user have selected a new language that text should is displayed in.
"touchscreen" The touchscreen has changed. (This should never normally happen.)
"keyboard" The keyboard type has changed-for example, the user had plugged in an external keyboard.
"keyboardHidden" The keyboard accessibility has changed-for example and the user has revealed the hardware keyboard.
"navigation" The navigation type (TRACKBALL/DPAD) has changed. (This should never normally happen.)
"screenLayout" The screen layout has changed-this might is caused by a different display being activated.
"fontScale" The font scaling factor has changed-the user have selected a new global font size.
"uiMode" The user interface mode has changed-this can is caused when the user places the device to a desk/car dock or when the The night mode changes. See UiModeManager . introduced in API level 8.
"orientation" The screen orientation have changed-the user has rotated the device.

Note: If your application targets API level A or higher ( minSdkVersion targetSdkVersion as declared by the and attributes), then you should also D Eclare "screenSize" the configuration, because it also changes when a device switches between portrait and landscape orientations .

" screensize " the current available screen size has changed. This represents a-currently available size, relative to the current aspect ratio, so would change when the US ER switches between landscape and portrait. However, if your application targets API level/lower, then your activity all handles this configuration change it Self (This configuration change does not restart your activity, even if running on an Android 3.2 or higher device).

Added in API level.

"smallestScreenSize" The physical screen size has changed. This represents a change in size regardless of orientation and so would only be change when the actual physical screens size has C Hanged such as switching to an external display. A change-to-this configuration, corresponds to a, thesmallestwidth configuration. However, if your application targets API level/lower, then your activity all handles this configuration change it Self (This configuration change does not restart your activity, even if running on an Android 3.2 or higher device).

Added in API level 13.

android:enabled

Whether the activity can be instantiated

android:excludeFromRecents

Whether it can be displayed in the recently opened Activity list

android:exported

Whether activity is allowed to be called by other programs

android:finishOnTaskLaunch

When the user restarts the task, whether to close the open activity

android:hardwareAccelerated

Whether to enable hardware acceleration

android:icon

Icon. Value is a picture resource

android:label

A visual label that is presented to the user.

android:launchMode

Activity start mode, the value is as follows:

"standard"
"singleTop"
"singleTask"
"singleInstance"

The default mode is " standard ".

Use
Cases Launch Mode multiple Instances? Comments
Normal launches for most activities "standard" Yes Default. The system always creates a new instance of the activity in the target task and routes the intent to it.
"singleTop" Conditionally If an instance of the activity already exists at the top of the target task, the system routes the intent to that instance Through a call onNewIntent() -to-its method, rather than creating a new instance of the activity.
Specialized launches
(Not recommended to general use)
"singleTask" No The system creates the activity at the root of a new task and routes the intent to it. However, if an instance of the activity already exists, the system routes the intent to existing instance through a call T o its onNewIntent() method, rather than creating a new one.
"singleInstance" No Same as " singleTask" , except that the system doesn ' t launch any and activities into the task holding the instance. The activity is always the A and only member of its task.

android:multiprocess

Can the activity run in the boot of his component?

android:name

Ancivity's name, which implements the name of the activity class.

android:noHistory

Whether the activity needs to be removed when the user switches to another screen.

android:parentActivityName

The class name of the logical parent class for this activity.

android:permission

The permissions required to run this acitvity

android:process

The name of the process in which the activity is run, and all program components run in the application's default process, which is the same name as the application's package name.

android:screenOrientation

Activity shows the mode "direction"

The value can is any one of the following strings:

"unspecified" The default value. The system chooses the orientation. The policy it uses, and therefore the choices made in specific contexts, could differ from device to device.
"user" The user ' s current preferred orientation.
"behind" The same orientation as the activity that's immediately beneath it in the activity stack.
"landscape" Landscape Orientation (the display is wider than it is tall).
"portrait" Portrait Orientation (the display is taller than it is wide).
"reverseLandscape" Landscape orientation in the opposite direction from normal Landscape. Added in API level 9.
"reversePortrait" Portrait orientation in the opposite direction from normal Portrait. Added in API level 9.
"sensorLandscape" Landscape orientation, but can is either normal or reverse Landscape based on the device sensor. Added in API level 9.
"sensorPortrait" Portrait orientation, but can is either normal or reverse Portrait based on the device sensor. Added in API level 9.
"sensor" The orientation is determined by the device orientation sensor. The orientation of the display depends on what the user is holding the device; It changes when the user rotates the device. Some devices, though, won't rotate to all four possible orientations, by default. To allow any four orientations "fullSensor" .
"fullSensor" The orientation is determined by the device orientation sensor for any of the 4 orientations. This "sensor" was similar to except this allows any of the 4 possible screens orientations, regardless of what the device would Normally do (for example, some devices won ' t normally use reverse portrait or reverse landscape, but this enables those). Added in API level 9.
"nosensor" The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display would not be rotate based on how the user moves the device. Except for this distinction, the system chooses the orientation using the same policy as for the " unspecified " setting.

android:stateNotNeeded

Activity is destroyed and successfully restarted without saving state

android:taskAffinity

The activity's kinship, by default, has the same relationship as the activity under an application

android:theme

Activity's style theme, if not set, the activity's theme style belongs to the application

android:uiOptions

Additional properties for the UI of the activity '. There are usually the following assignments:

Value Description
"none" No extra UI options. This is the default.
"splitActionBarWhenNarrow" Add a bar ActionBar at the bottom of the screen to display action items in the if constrained for horizontal space (such as Portrait mode on a handset). Instead of a small number of action items appearing in the action Bar at the top of the screen, the Action bar was split in To the top navigation sections and the bottom bar for action items. This ensures a reasonable amount of space are made available not only for the action items, but also for navigation and tit Le elements at the top. Menu items is not split across the bars; They always appear together.

android:windowSoftInputMode

Interaction mode between the Activity main window and the soft keyboard

<activityAndroid:windowsoftinputmode="Statevisible|adjustresize">   
Value Description
"stateUnspecified" The state of the soft keyboard (whether it was hidden or visible) is not specified. The system would choose an appropriate state or rely on the setting in the theme.

This is the default setting for the behavior of the soft keyboard.

"stateUnchanged" The soft keyboard is kept in whatever state it's last in, whether visible or hidden, when the activity comes to the fore .
"stateHidden" The soft keyboard is hidden when the user chooses the activity-that are, when the user affirmatively navigates forward to The activity, rather than backs into it because of leaving another activity.
"stateAlwaysHidden" The soft keyboard is always hidden when the activity's main window has input focus.
"stateVisible" The soft keyboard is visible if that's normally appropriate (when the user was navigating forward to the activity ' s main window).
"stateAlwaysVisible" The soft keyboard is made visible when the user chooses the activity-that are, when the user affirmatively navigates forw ARD to the activity, rather than backs into it because of leaving another activity.
"adjustUnspecified" It is unspecified whether the activity's main window resizes to make the soft keyboard, or whether the contents O f the window pan to make the currentfocus visible on-screen. The system would automatically select one of these modes depending on whether the content of the window have any layout view s that can scroll their contents. If There is such a view, the window would be resized, on the assumption that scrolling can make all of the window's content s visible within a smaller area.

The the default setting for the behavior of the main window.

"adjustResize" The activity's main window is all resized to make, and the soft keyboard on screen.
"adjustPan" The activity's main window is not a resized to make hostel for the soft keyboard. Rather, the contents of the window is automatically panned so, the current focus was never obscured by the keyboard an D users can always see what they is typing. This was generally less desirable than resizing, because the user could need to close the soft keyboard to get at and Interac T with obscured parts of the window.

Androidmanifest.xml-"Activity", application, Manifest

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.