语法:

<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>

父元素:

<manifest>

子元素:

<activity>
<activity-alias>
<service>
<receiver>
<provider>
<uses-library>

描述:应用的声明。这个元素的属性将会影响应用下的所有组件。很多属性为组件设置了默认值。有些属性设置了全局值并且不能被组件修改。

属性详解:

android:allowTaskReparenting

allowTaskReparenting的主要作用是activity的迁移,即从一个task迁移到另一个task,这个迁移跟activity的taskAffinity有关,必须是从一个跟该activitytaskAffinity不同的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 theActionBar, 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.

更多相关文章

  1. Android(安卓)Wi-Fi工作原理
  2. Android(安卓)全屏
  3. 默认不弹出输入面板
  4. Android画图Path的使用
  5. Android(安卓)Wear Preview - Get Started With Developer Previ
  6. android 动态设置background颜色
  7. react-native02:安卓返回键控制
  8. android 设置全屏,导航栏透明
  9. java.net.SocketTimeoutException: connect timed out

随机推荐

  1. 实验三、AndroidUI组件
  2. android对大图片的缓存处理
  3. Android Lamda 学习
  4. Android跳转系统相机或相册获取图片
  5. android 显示多选列表对话框
  6. android Settings项目安装
  7. android编程中setLayoutParams方法设置
  8. android html 读写文件
  9. Android学习——Android签名用keytool和j
  10. Android中Intent延时跳转的方法