[android] AndroidManifest.xml - 【 manifest -> application】
语法:
<application android:allowTaskReparenting=["true" | "false"]
android:backupAgent="string"
android:debuggable=["true" | "false"]
android:description="string resource"
android:enabled=["true" | "false"]
android:hasCode=["true" | "false"]
android:hardwareAccelerated=["true" | "false"]
android:icon="drawable resource"
android:killAfterRestore=["true" | "false"]
android:largeHeap=["true" | "false"]
android:label="string resource"
android:logo="drawable resource"
android:manageSpaceActivity="string"
android:name="string"
android:permission="string"
android:persistent=["true" | "false"]
android:process="string"
android:restoreAnyVersion=["true" | "false"]
android:taskAffinity="string"
android:theme="resource or theme"
android:uiOptions=["none" | "splitActionBarWhenNarrow"] >
. . .
</application>
父元素:
子元素:
<activity> <activity-alias> <service> <receiver> <provider> <uses-library>
描述:应用的声明。这个元素的属性将会影响应用下的所有组件。很多属性为组件设置了默认值。有些属性设置了全局值并且不能被组件修改。
属性详解:
android:allowTaskReparenting
allowTaskReparenting的主要作用是activity的迁移,即从一个task迁移到另一个task,这个迁移跟activity的taskAffinity有关,必须是从一个跟该activity taskAffinity不同的task中迁移到跟它taskAffinity相同的task中,只有在发生rese ttask时才会去使用这个标志,而我们从home上启动的程序都带了FLAG_ACTIVITY_RESET_TASK_IF_NEEDED。所以从home上启动程序会进行task reset.也就会使用到这个allowTaskReparenting。
android:backupAgent
完成应用数据实际备份和恢复任务及实际数据提供的BackupAgent对象由用户在应用程序中提供,并在应用的工程文件中的application标签下用android:backupAgent属性指定该BackupAgent对象。
android:debuggable
应用是否可以使用debug,甚至运行在用户模式下。true可以,false不能。默认为false。
android:description
用户可读的,比应用标签更长、更多的应用描述。此值必须是一个引用字符串。不像标签,他不能被设置为硬编码字符串。没有默认值。
android:hasCode
应用是否包含代码。true表示包含,false表示不包含。当值为false时,在启动组件是系统不会试着加载应用的任何代码。默认为true。
android:hardwareAccelerated
是否为应用启动硬件加速,从Android 3.0起开始支持。
android:icon
整个应用的图标,还是每个组件的默认图标。这个属性值必须被设置为drawable资源的引用。没有默认值。
android:killAfterRestore
在整型系统重置操作中,当他的设置被重置后,应用是否应该被终止。单个包的重置操作不会引起应用被关闭。整个系统的恢复操作仅代表
性的发生一次,当电话第一次被设置时。第三方应用将不会经常使用此属性。
默认值为true,意思是,当整个系统被恢复时,应用运行完它的数据后,将会终止。
android:largeHeap
应用进程是否创建一个大的虚拟堆存储
android:label
一个易读的应用标签,并且还是应用的每个组件的默认标签。这个标签应该被设置为引用字符串资源,当然他也可以像其他字符串一样在用户
接口中指定。但是为了方便,在应用开发时,可以被设置未定义字符串。
android:logo
整个应用的logo,也是activity默认的logo。
android:manageSpaceActivity
一个Activity子类的全限定名称,这个Activity可以被系统启动让用户管理此应用占有的存储空间。这个Activity也应该用<activity>元素声明。
android:permission
客户为了和应用交互必须设置的许可的名称。这个属性是一个便利的途径为应用的组件设置许可。他可以被组件的permission属性重写。
android:persistent
应用是否在所有时间下都保持运行。true是,false不是。默认为false。通常情况下应用不应该设置此标识。持久模式仅仅被几个系统应用指定。
android:restoreAnyVersion
表明这个应用准备尝试恢复所有的备份数据集合,甚至如果备份数据是比当前安装的应用高的编号存储的。设置为true将允许备份管理者去尝试
恢复当版本不匹配,意思是数据冲突。要小心使用。默认为false。
android:taskAffinity
提供给应用下所有组件的类同名称,除了设置了自己的taskAffinity属性的组件。默认情况下所有的组件使用相同的affinity。Affinity的名称
和在<manifest>元素中设置的包名相同。
android:theme
为应用下的组件定义一个引用自样式资源的主题。个别的activities可以设置自己的主题,通过设置自己的theme属性。
| Value | Description |
|---|---|
"none" |
使用默认的主题,没有额外的UI组件 |
"splitActionBarWhenNarrow" |
Add a bar at the bottom of the screen to display action items in the ActionBar, when constrained for horizontal space (such as when in portrait mode on a handset). Instead of a small number of action items appearing in the action bar at the top of the screen, the action bar is split into the top navigation section and the bottom bar for action items. This ensures a reasonable amount of space is made available not only for the action items, but also for navigation and title elements at the top. Menu items are not split across the two bars; they always appear together. |
[android] AndroidManifest.xml - 【 manifest -> application】的更多相关文章
- [android] AndroidManifest.xml - 【 manifest -> Application -> activity 】
<activity android:allowTaskReparenting=["true" | "false"] android:alwaysRetai ...
- [android] AndroidManifest.xml - 【 manifest -> permission】
在 API Level 1 时被引入 语法: <permission android:description="string resource" android:icon= ...
- [android] AndroidManifest.xml【 manifest -> uses-permission】
在 API Level 1 时被引入 简介: 在某些情况下,你为app设置的权限将会影响到google应用商店会用何种规则来过滤你的APP. 如果你需要一个硬件相关的权限——CAMERA,googl ...
- [android] AndroidManifest.xml -【manifest】
<manifest> 原文链接:http://www.android-doc.com/guide/topics/manifest/manifest-element.html 最早引入的AP ...
- [android] AndroidManifest.xml - 【 manifest -> 其他次要配置】
<uses-sdk> 作用:使应用程序的兼容性更好,指明应用程序需要的最小API,编译API以及最大支持的API.值都是整数 <uses-sdk android:minSdkVers ...
- [android] AndroidManifest.xml【 manifest -> permission-tree 和 manifest -> permission-group】
permission-tree 权限树 <permission-tree android:icon="drawable resource" android:label=&qu ...
- 高手速成android开源项目【导航篇】
Android开发又将带来新一轮热潮,很多开发者都投入到这个浪潮中去了,创造了许许多多相当优秀的应用.其中也有许许多多的开发者提供了应用开源项目,贡献出他们的智慧和创造力.学习开源代码是掌握技术的一个 ...
- Android Market 分析【安卓市场】
安卓市场: 通过对表的分析,“下载任务”的数据来源于数据库[app_download],“已安装”的数据来源于数据库[software_installed]. 数据分析:----- bash-3.2# ...
- android AndroidManifest.xml 属性详细解析
一.关于AndroidManifest.xml AndroidManifest.xml 是每个android程序中必须的文件.它位于整个项目的根目录,描述了package中暴露的组件(activiti ...
随机推荐
- 用thinkphp操作session
写了一段代码,对session进行一些常用的操作: <?php namespace Home\Controller; use Think\Controller; class Demo1Contr ...
- UVA - 10162 Last Digit
Description Problem B.Last Digit Background Give you a integer number N (1<=n<=2*10100). Ple ...
- TP框架中关于if、else 分支结构逻辑错误
TP框架中关于if.else 分支结构逻辑错误 代码中没有任何错误 将注释往下一行就可以解决 造成问题的原因: TP框架中 想分配变量可以使用assign方法 在[模块]中: $this->as ...
- excel 根据单元格内容自动调整列宽
excel 根据单元格内容自动调整列宽 CreateTime--2018年5月28日08:49:40 Author:Marydon 1.情景展示 单元格宽度超过了列宽 2.解决方案 第一步:同时选 ...
- php 一个过虑xxs的代码
一个过虑xxs的代码 public static function removeXSS($str) { $str = str_replace('<!-- -->', '', $str); ...
- 腾讯QQ的历史
http://www.agenow.com/bbs/DispText.aspx?id=1385106 OICQ: 大家都习惯性的认为OICQ是马化腾先生自己动手研发的,可在腾讯内部的网友之间又传来 ...
- Linux命令-权限管理命令:chown
选项:-R 处理指定目录以及其子目录下的所有文件 useradd wangyunpeng 创建一个用户名为wangyunpeng的用户 passwd wangyunpeng 给wangyunpeng这 ...
- Using AutoFac
第一次整理了下关于autofac的一些具体的用法 1. 安装 Autofac: Install-Package Autofac -Version 4.8.1 2. 创建两个类库项目,IService ...
- 如何读取xml文件,根据xml节点属性查询并输出xml文件
主要是应用SimpleXML和递归函数来根据key值来查询,并将结果以xml格式输出. <?php header("Content-type: text/xml"); //以 ...
- Lintcode---克隆二叉树
深度复制一个二叉树. 给定一个二叉树,返回一个他的 克隆品 . 您在真实的面试中是否遇到过这个题? Yes 样例 给定一个二叉树: 1 / \ 2 3 / \ 4 5 返回其相同结构相同数值的克隆二叉 ...