Android Development-api Guide-<activity-alias>

Source: Internet
Author: User

<activity-alias>

English Original: http://developer.android.com/guide/topics/manifest/activity-alias-element.html
Acquisition (update) Date: 2014-6-26
Moved from the original blog: http://blog.sina.com.cn/s/blog_48d491300100zmg5.html

Grammar:
<activity-aliasandroid:enabled=["true"| "false"] android:exported=["true"| "false"] Android:icon= "drawable resource"Android:label= "string resource"Android:name= "string"android:permission= "string"android:targetactivity= "string">    . . .</Activity-alias>
 
 
Included in:
<application>
can include:
<intent-filter>
<meta-data>
Description
targetActivity Specifies an alias for the Activity named by the property. The target Activity must be in the current application and must already be declared in manifest.

The alias represents the target Activity as another independent entity. The entity can have its own set of Intent filters instead of using the filters that the target Activity already has. These filters can determine which Intent can activate the target Activity through an alias and determine how the system handles the alias. For example, the Intent filter within the alias can set the " android.intent.action.MAIN " and " android.intent.category.LAUNCHER " flag so that it can be recognized by the program launcher, even if the target Activity does not have the filter set both flags.

targetActivityIn addition, <activity-alias> the attribute is a subset of the <activity> attributes. For an attribute that is already in the subset, the setting value in the target Activity does not overwrite the value in the alias. For a property that is not in a subset, the setting value in the target Activity applies to the alias as well.

Property:
android:enabled
Whether the system can instantiate the target with an alias activity-"" true means yes, " false " means no. The default value is " true ".

<application>Element has its own enabled properties, which apply to all components within the application, including Activity aliases. The system should be able to instantiate the target Activity with an alias, <application> and both <activity-alias> of these properties must be set to " true ". As long as one of them is " false ", the alias will not take effect.

android:exported
whether the components of other applications can use aliases to start the target activity-"" true means yes, " false " means no. If set to false , only components of an application with the same current or user ID can start the target Activity through an alias.

The default value depends on whether the alias contains a Intent filter. Not including any Intent filters means that you must specify an exact alias name to start the Activity. This means that the alias is for internal use only (because the other program does not know its full name)-The default value is " false ". Conversely, as long as more than one filter exists, it means that aliases can be used by external programs-The default value is " true ".

android:icon
the icon that the user sees when accessing the target activity with an alias. For details, see <activity> attributes of an element icon .
android:label
the text label that the user sees when accessing the target activity with an alias. For details, see <activity> attributes of an element label .
android:name
the unique name to use as the alias. The name should use a format similar to the fully qualified name of the class. However, unlike the name of the target Activity, the alias can be arbitrarily specified, and it does not represent the actual class.
android:permission
The name of the permission that must be owned by the client that initiated the target Activity through the alias or made it perform work. If startActivity() startActivityForResult() the caller or callers are not authorized, the target activity is not started.

This property supersedes the permissions of the target Activity itself. If this property is not set, it means that the target Activity can be started by an alias without authorization.

For more information about permissions, see the section on permissions in the introduction article.

android:targetActivity
Activity that can be started with an alias. The name must match the attributes of the element that is already defined in the manifest file <activity> name .
Introduced from:
API Level 1
See:
<activity>

Android Development-api Guide-<activity-alias>

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.