AndroidManifest. xml file (activity) (4)

Source: Internet
Author: User

 Android: multiprocess
This attribute is used to set whether the Activity instance can be loaded to the process where the component that starts the Activity is located. If it is set to true, yes; otherwise, no. The default value is false.
Generally, a new Activity instance is loaded into the process of the application that defines it, so that all the activities of the application can run in the same process. However, if this attribute is set to true, the instance of the Activity can run in multiple processes, it is almost never necessary to allow the system to create instances (with permission permits) in processes that use them.
Android: name
This attribute is used to set the name of the implementation class (subclass of the Activity) of the Activity. This attribute value should be a complete Java class name, such as com. example. project. ExtracurricularActivity. However, you can use the abbreviation. the first character of the name is indicated by the "." symbol, for example,. ExtracurricularActivity. The corresponding package name is specified in the <manifest> element.
Once an application is released, the name should not be changed (unless android: exported = "false" is set ").
This property has no default value and must be specified.
Android: noHistory
This attribute is used to determine whether the user should be deleted from the Activity stack when the user leaves the Activity and is no longer visible on the screen. If it is set to true, delete it. Otherwise, it is not deleted. The default value is false.
If this parameter is set to true, the Activity does not retain the historical track. That is to say, it will not be stored in the Activity stack of the task, so the user cannot return to this Activity.
This attribute is introduced in API Level 3.
Android: permission
This attribute is used to set the permissions required to start the Activity client or to respond to a Intent Object Request. If the caller of the startActivity () method or startActivityForResult () method is not granted the specified permission, its Intent object will not be sent to the corresponding Activity.
If this attribute is not set, the setting of the permission attribute in the <application> element is applied to the Activity element. If the <application> element is not set, the Activity will not be protected by permissions.
Android: process
This attribute is used to set the name of the process that the Activity should run. Generally, all components of an application run in a default process created for the application. It has the same name as the application package. <Application> the process attribute of the element can set a different default value for all components. However, each component can overwrite this default setting, allowing applications to be separated into multiple processes.
If the value of this attribute name starts with ":", a new process private to the application will be created as needed, this Activity will run in this process. If the process name starts with a lower-case letter, the Activity runs in a global process named after it with permission permits. In this way, components running different applications can share a process to reduce resource usage.
Android: screenOrientation
This attribute is used to set the display direction of the Activity on the device.
The attribute value can be a value listed in the following table:

Unspecified Default value. The system selects the direction. Its usage policies, as well as the context environment specific to the selected time, may vary with devices.
User Use the user's current preferred direction.
Behind Use the same direction of the Activity under the Activity in the Activity stack.
Landscape Horizontal display (the width is larger than the height)
Portrait Vertical display (the height is greater than the width)
ReverseLandscape It is displayed in the opposite direction of the normal horizontal direction and is introduced in API Level 9.
ReversePortrait It is displayed in the opposite direction of the normal vertical direction and is introduced in API Level 9.
SensorLandscape Horizontal display, but based on the device sensor, either display in the normal direction or reverse display, is introduced in API Level 9.
SensorPortrait Vertical display, but based on the device sensor, either display in the normal direction or reverse display, is introduced in API Level 9.
Sensor The display direction is determined by the device's direction sensor. The display direction depends on how the user holds the device. When the user rotates the device, the display direction changes. However, by default, some devices do not rotate in all four directions. Therefore, the fullSensor attribute value must be used to allow rotation in all four directions.
FullSensor The display direction (Four Directions) is determined by the device's direction sensor. In addition to allowing the screen to have four display directions, the display direction is similar to that set to "sensor, this is usually the case for devices. For example, some devices do not usually use vertical or horizontal inversion, but this setting still causes such inversion. This value is introduced in API Level 9.
Nosensor The display direction of the screen does not refer to the physical direction sensor. The sensor is ignored, so the display is not rotated by the user's mobile device. In addition to this difference, the system uses the same policy as "unspecified" to rotate the screen direction.
Note: When setting the value of this attribute to "landscape" or portrait, consider the hardware's operation direction Requirements for the Activity. Because of this, these declared values can be filtered by services such as Google Play, so that the application can only apply to devices that support the directions required by the Activity. For example, if you declare "landscape", "reverseLandscape", or "sensorLandscape", then the application can only be applied to devices that support horizontal display. However, you should also use the <uses-feature> element to explicitly declare whether all the screen directions of the application are vertical or horizontal. For example, <uses-feature android: name = "android. hardware. screen. portrait"/>. This setting is purely a filtering action provided by Google Play, and when the device only supports a specific direction, the platform itself does not control whether the application can be followed.
Android: stateNotNeeded
This attribute is used to set whether the Activity can be destroyed and restarted successfully without saving the Activity status. If it is set to true, the Activity can be restarted without referencing the previous status. If it is set to false, the previous status is required when the Activity is restarted. The default value is false.
Generally, the Activity will call the onSaveInstanceState () method to save the resource before it is finally disabled. This method uses a Bundle object to save the current status of the Activity, and then passes the Bundle object to the onCreate () method when the Activity is restarted. If this attribute is set to true, the onSaveInstanceState () method can not be called. When the onCreate () method is called, null is used to replace the Bundle object, just like the first restart of an Activity.
If this parameter is set to true, the Activity can be restarted by default. For example, if the Activity displayed on the home screen uses this setting, even if the Activity crashes for some reason, it will be ensured that it will not be deleted.
 



From FireOfStar's column

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.