<activity-alias>

英文原文:http://developer.android.com/guide/topics/manifest/activity-alias-element.html
采集(更新)日期:2014-6-26
搬迁自原博客:http://blog.sina.com.cn/s/blog_48d491300100zmg5.html

语法:
<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>

包含于:
<application>
可包含:
<intent-filter>
<meta-data>
说明:
targetActivity 属性命名的 Activity 指定别名。
目标 Activity 必须位于当前应用程序中,且必须已在 manifest 中声明。

别名将目标 Activity 表示为另一个独立的实体。
该实体可以拥有一套自己的 Intent 过滤器,而不使用目标 Activity 已有的过滤器。
这些过滤器可以决定哪些 Intent 能通过别名来激活目标 Activity,并且决定系统如何处理别名。
例如:别名内的 Intent 过滤器可以设定“
android.intent.action.MAIN”和“android.intent.category.LAUNCHER
标志,使之能被程序启动器识别,即使目标 Activity 没有过滤器设置了这两个标志也没关系。

targetActivity 外,<activity-alias> 的属性就是
<activity>
属性的子集。
对于该子集中已有的属性,目标 Activity 中的设置值不会覆盖别名里的值。
对于子集中没有的属性,则目标 Activity 中的设置值同时适用于别名。

属性:
android:enabled
系统能否用别名实例化目标 Activity —“true”表示可以,“false”表示不可以。
默认值是“true”。

<application>
元素拥有自己的 enabled 属性,
它适用于应用程序内的所有组件,包括 Activity 别名。
系统要能够用别名实例化目标 Activity ,
<application>
<activity-alias>的这两个属性必须同时设为“true”。
只要其中有一个是“false”,别名就不会生效。

android:exported
其它应用程序的组件能否用别名来启动目标 Activity —“true”表示可以,“false”表示不可以。
如果设为“false”,则只有当前或用户ID相同的应用程序的组件才能通过别名来启动目标 Activity。

默认值取决于别名是否包含 Intent 过滤器。
不包含任何 Intent 过滤器意味着必须指定精确的别名名称才能启动 Activity 。
这表示别名仅供程序内部使用(因为其他程序不知道它的完整名称)— 这时默认值是“false”。
反之,只要有一个以上过滤器存在,就意味着别名可以被外部程序使用 — 这时的默认值是“true”。

android:icon
用别名访问目标 Activity 时,用户看到的图标。详情请参阅
<activity>
元素的icon属性。
android:label
用别名访问目标 Activity 时,用户看到的文本标签。详情请参阅
<activity>
元素的label属性。
android:name
用作别名的唯一名称。
该名称应该使用类似于类的完全限定名相的格式。
但与目标 Activity 的名称不同,别名可以任意指定;它不代表实际的类。
android:permission
通过别名启动目标 Activity 或让它执行工作的客户端所必须拥有的权限名称。如果
startActivity()
startActivityForResult()
的调用者没有被授权,则目标 Activity 不会被启动。

本属性将取代目标 Activity 本身的权限。
如果本属性未设置,表示不需要授权即能通过别名启动目标 Activity。

有关权限的详细信息,请参阅介绍一文中的
权限 章节。

android:targetActivity
可以用别名启动的 Activity。该名称必须与 manifest 文件中已定义的
<activity>
元素的 name 属性相一致。

引入自:
API 级别 1
参阅:
<activity>

Android开发-API指南-<activity-alias>的更多相关文章

  1. Android开发-API指南-<permission>

    <permission> 英文原文:http://developer.android.com/guide/topics/manifest/permission-element.html 采 ...

  2. Android开发-API指南-<provider>

    <provider> 英文原文:http://developer.android.com/guide/topics/manifest/provider-element.html 采集(更新 ...

  3. Android开发-API指南-应用程序开发基础

    Application Fundamentals 英文原文:http://developer.android.com/guide/components/fundamentals.html 采集(更新) ...

  4. Android开发-API指南-Intent和Intent过滤器

    Intents and Intent Filters 英文原文:http://developer.android.com/guide/components/intents-filters.html 采 ...

  5. Android开发-API指南-Android简介

    Introduction to Android 英文原文:http://developer.android.com/intl/zh-cn/guide/index.html 采集日期:2014-4-16 ...

  6. Android开发-API指南-设备兼容性

    Device Compatibility 英文原文:http://developer.android.com/guide/practices/compatibility.html 采集日期:2014- ...

  7. Android开发-API指南-任务和回退栈

    Task and Back Stack 英文原文: http://developer.android.com/guide/components/tasks-and-back-stack.html 采集 ...

  8. 【最后一篇API译文】Android开发-API指南- Contacts Provider

    Contacts Provider 今年加入了某字幕组,加之杂事颇多,许久未添新文了,惭愧之极. 在听闻 Google 即将重返中国后,近日忽又发现官方网站正在放出 API 中文版,比如本文.当然不是 ...

  9. Android开发-API指南-创建 Content Provider

    Creating a Content Provider 英文原文:http://developer.android.com/guide/topics/providers/content-provide ...

  10. Android开发-API指南-Content Provider基础

    Content Provider Basics 英文原文:http://developer.android.com/guide/topics/providers/content-provider-ba ...

随机推荐

  1. 剑指offer系列19--栈的压入、弹出序列

    题目描述 输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序.假设压入栈的所有数字均不相等.例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序 ...

  2. poj1160 post office

    题目大意:有n个乡村,现在要建立m个邮局,邮局只能建在乡村里.现在要使每个乡村到离它最近的邮局距离的总和尽量小,求这个最小距离和. n<300,p<30,乡村的位置不超过10000. 分析 ...

  3. php获取从百度搜索进入网站的关键词

    <?php function search_word_from() { $referer = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REF ...

  4. 内存修改console

    #include <stdio.h> #include <windows.h> #include <winuser.h> int main() { int cur_ ...

  5. solr基于jetty容器配置后台登陆角色用户名密码

    solr版本4.0.0 我的solr下载后解压在d盘,你的随意. 在D:\apache-solr-4.0.0\apache-solr-4.0.0\example\etc目录下新建role.proper ...

  6. DG_Oracle DataGuard Failover主备节点切换(案例)

    2014-03-09 Created By BaoXinjian Thanks and Regards

  7. NeHe OpenGL教程 第十二课:显示列表

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  8. C语言小技巧

    /* 求阶乘时设置最大调用层数,防止栈占满 当从函数进入另一个函数时当前函数的内容会入栈,另一个函数调用完时在出栈 */ int factorial(int n, int level) { //pri ...

  9. 程序进入 EXPORT App_Fault_ISR的原因及措施:

    最近再UCOSIII+LPC1768上移植modbus,在定时器初始化部分竟然跑飞进入 EXPORT  App_Fault_ISR,查资料.逛论坛.问大牛都没有解决,最后发现竟然是犹豫一个低级失误引起 ...

  10. Category的使用

    1.创建一个objective-c file , 可以选择 category, extension ,protocol, empty 文件.选category 就能建立类别. category机制,它 ...