Summary of activity property setting in Android Development

Activity is one of the four most basic and common components in Android components. It is widely used in Android development. As a beginner, you need to master it. The following example is the common setting of activity property.

android:allowTaskReparenting @H_ 502_ 3 @ whether the activity is allowed to change dependent tasks, such as switching from SMS task to browser task.

android:alwaysRetainTaskState @H_ 502_ 3 @ whether to keep the status unchanged. For example, switch back to home and open it again. The activity is in the final state

android:clearTaskOnLanunch @H_ 502_ 3 @ for example, P is the activity, q is the activity triggered by P, and then return to home to restart P. do you want to display q

android:configChanges @H_ 502_ 3 @ when the configuration list is modified, whether to call the onconfigurationchanged () method, such as "locale|navigation|orientation"

android:enabled @H_ 502_ 3 @ can an activity be instantiated,

android:excludeFromRecents @H_ 502_ 3 @ can it be displayed in the recently opened activity list

android:exported @H_ 502_ 3 @ allow activity to be called by other programs

android:finishOnTaskLaunch @H_ 502_ 3 @ close the opened activity when the user restarts the task

android.icon

android:label

android:launchMode @H_ 502_ 3 @ activity startup method, "standard" "singletop" "singletask" "singleinstance" @ h_ 502_ 3 @ the first two are a group and the last two are a group

@H_ 502_ 3@ android:multiprocess @H_ 502_ 3 @ allow multiple processes

android:name @H_ 502_ The class name of 3 @ activity must be specified

androidnHistory @H_ 502_ 3 @ whether this activity needs to be removed when the user switches to another screen. This attribute is introduced in API Level 3

android:permission

android:process @H_ 502_ 3@ a process name where the activity runs. All program components run in the default process of the application. This process name is consistent with the package name of the application. The process attribute of the element in can set a new default value for all components. However, any component can override this default value, allowing you to run your program in multiple processes. If the name assigned to this attribute starts with:, when the activity runs, a new process dedicated to the 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 @H_ 502_ 3 @ activity display mode, "unspecified" default value is "landscape" landscape mode, the width is larger than the height, and "portrait" portrait mode, the height is larger than the width. "User" user's setting "behind" "sensor" "nosensor"

android:stateNotNeeded @H_ 502_ 3 @ whether the activity is destroyed and successfully restarted does not save the state

android:taskAffinity @H_ 502_ 3 @ kinship of an activity. By default, activities in the same application have the same relationship

android:theme @H_ 502_ 3 @ the theme style of the activity. If it is not set, the theme style of the activity belongs to the application. See the theme attribute of the element

android:windowSoftInputMode @H_ 502_ The interaction mode between 3 @ activity main window and soft keyboard has been introduced into @ h since API Level 3_ 502_ 3@ how the active main window interacts with the window containing the soft keyboard on the screen. The setting of this property will affect two things: @ h_ 502_ 3 @ 1 > the status of the soft keyboard - whether it is hidden or displayed - when the activity becomes the focus of the user's attention@ H_ 502_ 3 @ 2 > active main window adjustment - whether to reduce the size of the active main window to make room for the soft keyboard, or whether the current focus of its content is visible when part of the active window is covered by the soft keyboard@ H_ 502_ 3@ its setting must be a value in the following list, or a combination of "state..." value and "adjust...". Set multiple values in any group -- multiple "state..." values, for example & mdash, with undefined results. The values are separated by |. For example: < activity Android: windowsoftinputmode = "statevisible|adjustresize".... > @ h_ 502_ 3 @ the value set here (except "stateunspecified" and "adjustunspecified") will override the value set in the topic @ H_ 502_ 3 @ 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 theme dependent setting. This is the default setting for software disk behavior.

The "state unchanged" soft keyboard is maintained regardless of its last state, whether it is 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, rather than return to it due to leaving another activity.

The "statealwaysshidden" soft keyboard is always hidden when the activity main window gets the focus.

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

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

"Adjustunspecified" it is not specified whether the main window of the activity is resized to make room for the soft keyboard, or whether the content on the window is visible to the current focus on the screen. The system will automatically select one of these modes, which mainly depends on whether any layout view of the contents of the window can scroll their contents. If there is such a view, the window will be resized. This assumption can make the contents of the scrolling window visible in a smaller area. This is the default behavior setting of the main window.

"Adjustresize" the main window of the activity is always resized to make room for the soft keyboard.

"Adjustpan" the main window of the activity does not resize the screen to make room for the soft keyboard. On the contrary, the content of the current window will automatically move so that the current focus is never covered by the keyboard and the user can always see the part of the input content. This is usually not expected than resizing, because the user may turn off the soft keyboard to obtain interaction with the overwritten content.

The above is the whole content of this article. I hope you can like it.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>