Androidmanifest. xml file (activity) (5)

Source: Internet
Author: User

Android: taskaffinity

This attribute is used for tasks that are closely related to the activity. Activities with the same kinship belong to the same task in terms of concept (from the user's perspective, they belong to the same application ). The kinship of a task is determined by the kinship of the activity of its root node.

Kinship determines two things: 1. Whether the activity can reset the parent task (depending on the allowtaskreparenting attribute); 2. whether the task can contain the activity marked with flag_activity_new_task.

By default, all activities in an application have the same kinship. You can assign the activity to different groups by setting this attribute. You can even put the activity defined in different applications in the same task. To specify an activity that is unrelated to any task, set this attribute to a null string.

If this attribute is not set, the activity inherits the kinship of the application (see the taskaffinity attribute of the <Application> element ). The default kinship name of the application is set by the package attribute of the <manifest> element.

Android: Theme

This attribute is used to set the overall theme of an activity. It applies a style resource. The system uses this topic to automatically set the activity content.

If this attribute is not set, the activity will inherit the theme attribute of the <Application> element to make its overall style. If this attribute is not set, the system topic is used by default.

Android: uioptions

This attribute is used to set additional options for the UI of the activity. It must be a value in the following table.

Value

Description

None

By default, no additional UI options are available.

Splitactionbarwhennarrow

When the horizontal space is limited, a bar is added at the bottom of the screen to display the operation items in the actionbar, for example, on a portrait handheld device. Instead of displaying a small number of operation items in the action bar at the top of the screen. It divides the operation column into the upper and lower parts. The top is used for navigation selection, and the bottom is used for project operations. This ensures that the available space is not only for the operation project, but also for the navigation and title at the top. Menu items cannot be separated into two columns. They must be displayed together.

 

This attribute is introduced in API Level 14.

Android: windowsoftinputmode

This attribute is used to set how the main window of the activity interacts with the window of the software keyboard. Setting this attribute will affect the following two things:

1. Soft Keyboard status-whether the soft keyboard is hidden or displayed when the activity obtains the input focus.

2. adjust the main window of the activity-adjust the size of the Main Window of the activity to make room for display on the keyboard; or make the content in the activity window Pan when the input focus in the activity window is overwritten by the keyboard, so that the input focus can be displayed to the user.

This attribute must be set with a value in the following table, or a state... And an adjust... . For example:

<Activityandroid: windowsoftinputmode = "statevisible | adjustresize"
...>

The value set in this attribute overwrites the value set in the topic.

Value

Description

Stateunspecified

It does not specify the keyboard status (display or hide ). The system selects an appropriate status or depends on the settings in the topic.

It is the default setting for Soft Keyboard behavior.

Stateunchanged

When the activity is displayed on the foreground, the keyboard will keep its final state (show or hide)

Statehidden

When you select this activity, the keyboard is hidden. That is to say, when the user confirms to browse this activity, instead of returning this activity because he leaves another activity.

Statealwayshidden

When the activity's main window has an input focus, the keyboard will always hide

Statevisible

When appropriate (usually the user browses the main window of the activity), the keyboard is visible.

Statealwaysvisible

When the user selects this activity, the soft keyboard becomes visible, that is, when the user confirms to browse this activity, instead of returning this activity because he leaves another activity.

Adjustunspecified

This value does not specify whether the main window of the activity will be displayed on the keyboard and adjust the size. It does not specify whether the main window of the activity will be translated, so that the input focus blocked by the keyboard can be displayed to the user. The system automatically selects the two modes based on whether the content in the content window can be rolled. If the activity window has a scrolling layout, the window will be adjusted and it is assumed that the window can be browsed in a small area by scrolling.

Adjustresize

To adapt to the display of the soft keyboard, the main window of the activity must always be adjusted.

Adjustpan

The main window of the activity will not be adjusted by the keyboard. On the contrary, the content in the window will be automatically translated so that the input focus will not be blocked by the keyboard, the user can see the content they entered. This mode is rarely used, because you may need to turn off the keyboard to interact with it.

This attribute is introduced in API Level 3.

Introduced in)

Other than the nohistory and windowsoftinputmode attributes (these two attributes are introduced in API level 3), and all other attributes are introduced in API Level 1.

 

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.