Summary of activity attribute settings in Android development _android

Source: Internet
Author: User

Activity is one of the most basic and common components of the Android component, and is widely used as a beginner in Android development, and the following examples are common settings for activity properties.

Android:allowtaskreparenting
Allows the activity to replace dependent tasks, such as switching from short message tasks to browser tasks.

Android:alwaysretaintaskstate
Whether to keep the status unchanged, such as switching back to home, and then open again, the activity in the final state

Android:cleartaskonlanunch
For example, p is an activity, Q is an activity that is triggered by P, and then returns home, starting with a new p, whether or not to show Q

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

Android:enabled
Whether the activity can be instantiated,

Android:excludefromrecents
Whether it can be displayed in the recently opened Activity list

android:exported
Whether to allow activity to be called by other programs

Android:finishontasklaunch
Whether to close an open activity when the user restarts the task

Android.icon

Android:label

Android:launchmode
Activity initiation Mode, "standard" "Singletop" "Singletask" "SingleInstance"
The first two are a group and the last two are a group


Android:multiprocess
Allow multiple processes

Android:name
The class name of the activity, which must be specified

Androidnhistory
Whether you need to remove this activity when the user switches to another screen. This attribute is introduced in API level 3

Android:permission

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 as the package name of the application. The element process attribute in can set a new default value for all components. But any component can override this default value, allowing you to run your program in multiple processes. If this attribute is assigned the name with: The beginning, when the activity runs, a new process that is exclusive to this program will be created. If the process name starts with a lowercase letter, the activity will run in the global process and be provided by its license.

Android:screenorientation
Activity shows the mode, "unspecified" default value "Landscape" landscape pattern, the width is larger than the height of some "portrait" portrait mode, height is larger than the width. User's settings "behind" "Sensor" "Nosensor"

android:statenotneeded
Whether the activity is destroyed and successfully restarted does not save the state

Android:taskaffinity
The relationship of activity, by default, is the same as an activity under an application.

Android:theme
The style theme of the activity, if not set, the subject style of the activity is subordinate to the application, see the element's Theme property

Android:windowsoftinputmode
The interaction mode between the active main window and the soft keyboard has been introduced since API Level 3
How the active main window interacts with the Soft keyboard window that contains the screen. The setting of this property will affect two things:
1> the state of the soft keyboard-whether it is hidden or displayed-when the activity becomes the focus of the user's attention.
2> Active main Window adjustment-whether to reduce the active main window size to make room for soft keyboards or whether the current focus of its content is visible when the active window is partially covered by a soft keyboard.
Its setting must be a value in the following list, or a combination of a "state ..." value plus a "adjust ..." value. Set multiple values in either group-multiple "state ..." values such as &mdash have undefined results. Each value is separated by | For example: <activity android:windowsoftinputmode= "Statevisible|adjustresize" ... >
The values set here (except "stateunspecified" and "adjustunspecified") override the values set in the theme
Value Description

The state of the "stateunspecified" soft keyboard (whether it is hidden or visible) is not specified. The system will select an appropriate state or a theme-dependent setting. This is the default setting for the software disk behavior.

The "stateunchanged" soft keyboard is kept, regardless of its last state, visible or hidden, when the main window appears in front.

"Statehidden" When the user selects the activity, the soft keyboard is hidden-that is, when the user determines to navigate to the activity, instead of returning to it because of leaving another activity.

The "Statealwayshidden" soft keyboard is always hidden when the active main window gets the focus.

The "statevisible" soft keyboard is visible when that is normally appropriate (when the user navigates to the main activity window).

"Statealwaysvisible" When the user chooses this activity, the soft keyboard is visible-that is, when the user determines to navigate to the activity, rather than returning it due to leaving another activity.

"Adjustunspecified" It is not specified whether the active main window is resized to allow space for the soft keyboard, or whether the contents of the window get the current focus on the screen to be visible. The system will automatically select one of these modes that is primarily dependent on whether the contents of the window have any layout view to scroll their content. If you have such a view, the window will resize so that the contents of the scrolling window are visible in a smaller area. This is the default behavior setting for the main window.

"Adjustresize" The activity main window is always resized to allow for soft keyboard space.

"Adjustpan" The Activity main window does not resize the screen to allow space for the soft keyboard. Instead, the contents of the current window will be automatically moved so that the current focus is never overwritten by the keyboard and the user can always see the input part. This is usually not expected to be larger than the resizing, because the user may close the soft keyboard to gain interaction with the overwritten content.

The above mentioned is the entire content of this article, I hope you can enjoy.

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.