activity-alias

SYNTAX:
<activity-alias android: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>
CONTAINED IN:
<application>
CAN CONTAIN:
<intent-filter> 
<meta-data>
DESCRIPTION:
An alias for an activity, named by the  targetActivity attribute. The target must be in the same application as the alias and it must be declared before the alias in the manifest.

The alias presents the target activity as a independent entity. It can have its own set of intent filters, and they, rather than the intent filters on the target activity itself, determine which intents can activate the target through the alias and how the system treats the alias. For example, the intent filters on the alias may specify the "android.intent.action.MAIN" and "android.intent.category.LAUNCHER" flags, causing it to be represented in the application launcher, even though none of the filters on the target activity itself set these flags.

With the exception of targetActivity<activity-alias> attributes are a subset of <activity>attributes. For attributes in the subset, none of the values set for the target carry over to the alias. However, for attributes not in the subset, the values set for the target activity also apply to the alias.

ATTRIBUTES:
android:enabled
Whether or not the target activity can be instantiated by the system through this alias — " true" if it can be, and " false" if not. The default value is " true".

The <application> element has its own enabled attribute that applies to all application components, including activity aliases. The <application> and <activity-alias> attributes must both be "true" for the system to be able to instantiate the target activity through the alias. If either is "false", the alias does not work.

android:exported
Whether or not components of other applications can launch the target activity through this alias — " true" if they can, and " false" if not. If " false", the target activity can be launched through the alias only by components of the same application as the alias or applications with the same user ID.

The default value depends on whether the alias contains intent filters. The absence of any filters means that the activity can be invoked through the alias only by specifying the exact name of the alias. This implies that the alias is intended only for application-internal use (since others would not know its name) — so the default value is "false". On the other hand, the presence of at least one filter implies that the alias is intended for external use — so the default value is "true".

android:icon
An icon for the target activity when presented to users through the alias. See the  <activity>element's  icon attribute for more information.
android:label
A user-readable label for the alias when presented to users through the alias. See the  <activity>element's  label attribute for more information.

android:name
A unique name for the alias. The name should resemble a fully qualified class name. But, unlike the name of the target activity, the alias name is arbitrary; it does not refer to an actual class.

android:permission
The name of a permission that clients must have to launch the target activity or get it to do something via the alias. If a caller of  startActivity() or  startActivityForResult() has not been granted the specified permission, the target activity will not be activated.

This attribute supplants any permission set for the target activity itself. If it is not set, a permission is not needed to activate the target through the alias.

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

android:targetActivity
The name of the activity that can be activated through the alias. This name must match the  nameattribute of an  <activity> element that precedes the alias in the manifest.

INTRODUCED IN:
API Level 1
SEE ALSO:

<activity>


句法:
<activity-alias  android: enabled = ["true" | "false" ] 
                android: exported = ["true" | "false" ] 
                android: icon = " drawable资源
                机器人:标签 = 字符串资源
                机器人:名字 = 字符串
                机器人:权限 = 字符串
                机器人:targetActivity = 字符串 > 
    。
</活动别名>
包含在:
<应用程序>
可以包含:
<意图过滤器> 
<元数据>
描述:
为活动的别名,由指定的 targetActivity 属性。目标必须在同一应用程序的别名,它必须在清单中的别名之前声明。

别名提出了目标活动作为一个独立的实体。它可以有它自己的一套意图过滤器的,并且它们的,而不是在目标活动本身的意图过滤器,确定哪个意图可以通过别名以及系统如何对待别名激活目标。例如,别名的意图滤波器可以指定“ android.intent.action.MAIN ”和“ android.intent.category.LAUNCHER ”标志,导致它在应用程序启动来表示,即使没有任何过滤器的上目标活动本身设置这些标志。

随着外targetActivity<活动的别名> 属性的一个子集<活动>属性。对于子集的属性,没有目标设定值结转到别名。但是,对于不在该子集中的属性,为目标活动设置的值也适用于别名。

属性:
机器人:启用
“ -不管是不是目标活动可以由系统通过这个别名实例化 真正 ”如果可以,和“   ”如果不是。缺省值是“   ”。

<应用程序>元素都有自己的 启用适用于所有应用程序组件,包括活动的别名属性。在 <应用程序><活动别名> 属性必须都是“ 真实的系统能够通过别名来实例化目标活动”。如果任一为“  ”,别名不起作用。

机器人:出口
不管是不是其他应用程序的组件可以通过这个别名启动 ​​目标活动- “   ”,如果他们能和“   ”如果不是。如果“   ”,则目标活性可通过别名仅由相同的应用程序作为别名或应用程序具有相同的用户ID的部件启动。

默认值依赖于别名是否含有意图过滤器。没有任何过滤器意味着该活动可以通过别名只能通过指定别 ​​名的确切名称调用。这意味着,该别名仅用于应用程序内部使用(因为其他人将不知道它的名字) -这样的默认值是“  ”。另一方面,至少一个过滤器的存在意味着该别名是用于外部使用-这样的默认值是“  ”。

安卓图标
为目标活性的图标时通过别名呈现给用户。请参阅 <活动>元素的  图标属性的详细信息。
机器人:标签
了别名用户可读标签时通过别名呈现给用户。请参阅 <活动>元素的  标签属性的更多信息。

安卓:名称
的唯一名称的别名。这个名字应该像一个完全合格的类名。但是,与目标活动的名称,别名是任意的;它不是指实际的类。

机器人:许可
该客户端必须启动目标活动,或让它通过别名做些什么权限的名称。如果主叫方 startActivity()或  startActivityForResult() 没有被授予指定的许可,目标活动将不会被激活。

该属性取代了目标活动本身设置的任何许可。如果它没有被设置,则不需要许可通过别名来激活目标。

有关权限的详细信息,请参阅 权限 在引进部分。

机器人:targetActivity
可通过别名激活的活动的名称。该名称必须与相匹配 的名称的属性  <活动>元素,在清单前面的别名。

介绍了:
API级别1
也可以看看:
<活动>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值