Androidmainifest Label Usage Instructions 2--<activity>

Source: Internet
Author: User
Tags home screen

Format:

<activity android: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= "St Ring "android:screenorientation=[" Unspecified "|                                     "Behind" | "Landscape" |                                     "Portrait" | "Reverselandscape" |                                     "Reverseportrait" | "Sensorlandscape" |                                     "Sensorportrait" | "Userlandscape" |                                     "Userportrait" | "Sensor" | "Fullsensor" |                                     "Nosensor" | "User" | "Fulluser" | "Locked"] android:statenotneeded=["true" | "false"] android:taskaffinity= "string" android:theme= "resource or Theme" android:uioptions=["No Ne "|                                       "Splitactionbarwhennarrow"] android:windowsoftinputmode=["stateunspecified",       "Stateunchanged", "Statehidden",                                "Statealwayshidden", "statevisible", "Statealwaysvis Ible "," adjustunspecified "," Adjustresize "," Adjustpan "] > ... </activi Ty>

Parent Tag:<application>


Sub-label:<intent-filter>
<meta-data>


Description: Each activity must be declared in the Mainifest file, and no declared activity system is considered invisible and will not be called by the system.

Parameters:

Android:allowtaskreparenting default false.
This property is used to mark whether an activity instance can move from the task that initiates it to a task with a common affinity after the current application has retired, "true" means that it can be moved and "false" means that it must be in the currently applied task.


Android:alwaysretaintaskstate default false.
This property is used to mark whether the applied task remains in its original state, "true" means that it is always persisted, and "false" means that it cannot be guaranteed. By default, if an app is in the background for too long, for example 30 minutes, when the user selects the app from the main menu again, the system cleans up the application's task, except the root activity, the other activity will be cleared out of the stack. However, if you set this property in root activity, you can still see the interface of the previous operation when the user launches the app again.


Android:cleartaskonlaunch default false.
This parameter means that whenever the activity is restarted from home screen, the event is the first to be launched as soon as you press the desktop icon. But the only thing to keep in mind is that if you press the home build then that means the activity isn't over, so you're not going to start it for the first time. This activity will be initiated for the first time only if you press back or end a behavior that represents the end of activity. Often android:cleartaskonlaunch= "True" is a main entry.


Android:configchanges when the content parameter changes in the list configured at run time, the onconfigurationchanged () is called. Configuring multiple content is available through the ' | ' Way, such as "locale|navigation|orientation". Here are some things that you can configure:
"MCC"IMSI Mobile Country Code Changes
"MNC"IMSI code changes for mobile networks
"Locale"Location change, when the user chooses a new language
"Touchscreen"Touch screen changes. (This should not normally happen)
"Keyboard"When the keyboard type changes
"Keyboardhidden"Keyboard accessibility has changed-for example, the user displays a hardware keyboard.
"Navigation"The navigation type changes. (This should not normally happen)
"Screenlayout"The screen layout has changed-this may be due to different displays being activated.
"Fontscale"Font size Change
"Uimode"The user interface mode has changed, which can result when the user puts the device on the desk/car dock or when the night mode changes.
"Orientation"The screen orientation has changed-the user spins the device.
"ScreenSize"The currently available screen size has changed
"Smallestscreensize"The physical screen size has changed
"LayoutDirection"The orientation of the layout has changed.


Android:enabled default True
Whether the activity can be instantiated by the system-"true" if it can, if not "false".


Android:excludefromrecents default True
Whether the task initiates this activity should be excluded from the list of recently used applications. Set "true" if this task should be excluded from the list, set whether "false" should be included.


Android:exported Default False
Whether the activity can be opened by other components of the application, "true" can, "false" cannot.


Android:finishontasklaunch Default False
If you open this transaction again, then the original will not be closed. "True" turns off the original, "false" does not close.


Android:hardwareaccelerated Default False
Whether hardware-accelerated rendering should support this activity.


Android:icon setting icon


Android:label Settings tab


How to start the Android:launchmodeactivity
"Standard"By default, the system will always create a new activity instance in the target stack and set the intent path.
"Singletop"If an activity already exists at the top of the target stack, the system creates a new intent with the Onnewintent () method instead of creating a new activity
"Singletask"If the activity is not found, a new activity is created at the bottom of the task stack, Onnewintent () a new intent instead of a new activity if the activity already exists.
"SingleInstance"As with "Singletask", except that the system does not start any other activity to save the instance to the task stack. Activity is always a singleton, the only member of a task stack.


Android:multiprocess Default False
Whether an activity instance can be created by its component is started in a process. Typically, a new instance of an activity-initiated process is defined by the application, so all instances of the activity run in the same process. However, if this flag is set to "true", the active instance can run multiple processes, allowing the system to create an instance (with permission to allow it) regardless of whether it is used, which is almost never necessary or desirable.


The name of the android:nameactivity, such as "com.example.project.ExtracurricularActivity"


Android:nohistory Default False
When you leave the activity it is not available, and the activity is able to remove and Finishi () from the stack. "True" means that activity does not leave traces of history. It will not remain on the activity stack of the task, so the user will not be able to return.


Android:parentactivityname the name of the logical parent class. The system reads this property to determine which activities should start using the push button in the action Bar. The system can also use this information to synthesize activities with Taskstackbuilder back to the stack.


Android:permission the name of the permission, the customer must initiate the activity or let it reply to the intent. If the caller startactivity () or Startactivityforresult () is not granted the specified license, its intent will not be to deliver the activity. If this property is not set, the license properties of the set license <application> element apply to the activity. If there is no property set, the activity is not protected by rights.


The process name where the android:processactivity is located, usually not required.


The direction displayed by the android:screenorientationactivity. Choose any of the following:
"Unspecified"By default, the system is selected.
"Behind"In the same direction as the activity under its stack.
"Landscape"Landscape mode, show ground ratio aspect
"Portrait"Sketch mode, showing the height of the ground than the width
"Reverselandscape"The transverse opposite direction from the normal landscape.
"Reverseportrait"Xiaoxiangfang to the opposite direction from the normal portrait
"Sensorlandscape"Transverse, but can be normal or reverse the sensor on the landscape base device.
"Sensorportrait"Portrait orientation, but can be normal or reverse portrait based on device sensor.
"Userlandscape"Transverse, but can be normal or reverse landscape depending on the user's device sensor and sensor preferences. If the user has locked the sensor rotation, it is landscape, and conversely, it is sensorlandscape.
"Userportrait"Portrait orientation, but can be normal or reverse portrait based on user device sensor and sensor preferences. If the user has locked the sensor rotation, it is portrait, and conversely, it is sensorportrait.
"Sensor"The direction is by the device direction sensor. The direction of the display depends on the user's device, which changes when the user rotates the device. However, some devices do not rotate four possible directions, by default. All four directions are allowed, using "fullsensor".
"Fullsensor"The direction is the 4 directions of the sensor positioned by the device. This is similar to "sensor", except that this allows any possible 4 screen orientation, regardless of what the device usually does
"Nosensor"The direction determines that the physical direction sensor is not considered. The sensor is ignored, so the display does not rotate according to the user mobile device. In addition to this distinction, the system chooses to use the same policy-oriented "unspecified" setting.
"User"The user's current preferred orientation.
"Fulluser"If the user has locked the sensor rotation, it is "user", conversely, "fullsensor" and allows any possible 4 screen orientation.
"Locked"Lock direction current rotation, no tube what this is.


Android:statenotneeded Default False
Whether the activity is able to kill and not require a stateless hold restart.


The android:taskaffinity activity has an associated task stack.


Android:theme The overall style of the resource reference defines a theme activity. This automatically sets the context of the activity to use this topic.


An additional option for the Android:uioptionsactivity UI. Must be one of the following values:
"None" Default, No.
"Splitactionbarwhennarrow"The Add bar is located at the bottom of the screen, and the Action bar displays the action item when the horizontal space is constrained. Instead of the few action items that appear in the action bar above the screen, the action Bar is divided into the top navigation section and the bottom bar of the action item. This ensures a reasonable amount of space available not only for action items, but also for navigating at the top and heading elements. menu items do not split in two columns; they always appear together.


Android:windowsoftinputmode window soft keyboard mode. Setup method:
<activity android:windowsoftinputmode= "Statevisible|adjustresize" ... >
Introduction to Parameters:
"Stateunspecified"By default, no special requirements are set.
"Stateunchanged"Soft keyboard Last saved in any state, whether visible or hidden, when the activity goes to the foreground.
"Statehidden"The soft keyboard is hidden when the user chooses activity.
"Statealwayshidden"is always hidden.
"Statevisible"Visible, when activity is activated
"Statealwaysvisible"Always visible.
"Adjustunspecified"The size of the active main form is not specified whether it is a soft keyboard, or whether the contents of the window are visible to the current focus on the screen. These modes are automatically selected by the system depending on the contents of the window with any layout view that can scroll the content. If there is such a view, the window size, assuming scrolling can make all visible window contents in a smaller area.
"Adjustresize"The active main window will always be resized so that the soft keyboard is in the window
"Adjustpan"The active main window is not a soft keyboard resizing to make room. Instead, the window automatically arranges the contents, the current focus will never be obtained by the keyboard, and the user can see them typing. This is usually undesirable than tuning, because the user may need to close the soft keyboard with the masked part and interact with the window.

Related Article

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.