<activity android:allowTaskReparenting=["true" | "false"]
android:alwaysRetainTaskState=["true" | "false"]
android:clearTaskOnLaunch=["true" | "false"]
android:configChanges=["mcc", "mnc", "locale",
"touchscreen", "keyboard", "keyboardHidden",
"navigation", "screenLayout", "fontScale", "uiMode",
"orientation", "screenSize", "smallestScreenSize"]
android:enabled=["true" | "false"]
android:excludeFromRecents=["true" | "false"]
android:exported=["true" | "false"]
android:finishOnTaskLaunch=["true" | "false"]
android:hardwareAccelerated=["true" | "false"]
android:icon="drawable resource"
android:label="string resource"
android:launchMode=["multiple" | "singleTop" | "singleTask" | "singleInstance"]
android:multiprocess=["true" | "false"]
android:name="string"
android:noHistory=["true" | "false"]
android:parentActivityName="string"
android:permission="string"
android:process="string"
android:screenOrientation=["unspecified" | "user" | "behind" |
"landscape" | "portrait" |
"reverseLandscape" | "reversePortrait" |
"sensorLandscape" | "sensorPortrait" |
"sensor" | "fullSensor" | "nosensor"]
android:stateNotNeeded=["true" | "false"]
android:taskAffinity="string"
android:theme="resource or theme"
android:uiOptions=["none" | "splitActionBarWhenNarrow"]
android:windowSoftInputMode=["stateUnspecified",
"stateUnchanged", "stateHidden",
"stateAlwaysHidden", "stateVisible",
"stateAlwaysVisible", "adjustUnspecified",
"adjustResize", "adjustPan"] >
. . .
</activity>

父元素:

<application>

子元素:

<intent-filter> 
<meta-data>

属性:

android:allowTaskReparenting

是否允许activity更换从属的任务,比如从短信息任务切换到浏览器任务。

android:alwaysRetainTaskState

是否保留状态不变, 比如切换回home, 再从新打开, activity处于最后的状态

android:clearTaskOnLaunch

比如 P 是 activity, Q 是被P 触发的 activity, 然后返回Home, 从新启动 P, 是否显示 Q

android:configChanges

当配置list发生修改时, 是否调用 onConfigurationChanged() 方法 比如 "locale|navigation|orientation".

Value Description
"mcc" The IMSI mobile country code (MCC) has changed — a SIM has been detected and updated the MCC.
"mnc" The IMSI mobile network code (MNC) has changed — a SIM has been detected and updated the MNC.
"locale" The locale has changed — the user has selected a new language that text should be displayed in.
"touchscreen" The touchscreen has changed. (This should never normally happen.)
"keyboard" The keyboard type has changed — for example, the user has plugged in an external keyboard.
"keyboardHidden" The keyboard accessibility has changed — for example, the user has revealed the hardware keyboard.
"navigation" The navigation type (trackball/dpad) has changed. (This should never normally happen.)
"screenLayout" The screen layout has changed — this might be caused by a different display being activated.
"fontScale" The font scaling factor has changed — the user has selected a new global font size.
"uiMode" The user interface mode has changed — this can be caused when the user places the device into a desk/car dock or when the the night mode changes. See UiModeManagerIntroduced in API Level 8.
"orientation" The screen orientation has changed — the user has rotated the device.

Note: If your application targets API level 13 or higher (as declared by the minSdkVersion and targetSdkVersion attributes), then you should also declare the "screenSize" configuration, because it also changes when a device switches between portrait and landscape orientations.

"screenSize" The current available screen size has changed. This represents a change in the currently available size, relative to the current aspect ratio, so will change when the user switches between landscape and portrait. However, if your application targets API level 12 or lower, then your activity always handles this configuration change itself (this configuration change does not restart your activity, even when running on an Android 3.2 or higher device).

Added in API level 13.

"smallestScreenSize" The physical screen size has changed. This represents a change in size regardless of orientation, so will only change when the actual physical screen size has changed such as switching to an external display. A change to this configuration corresponds to a change in thesmallestWidth configuration. However, if your application targets API level 12 or lower, then your activity always handles this configuration change itself (this configuration change does not restart your activity, even when running on an Android 3.2 or higher device).

Added in API level 13.

android:enabled

activity 是否可以被实例化

android:excludeFromRecents

是否可被显示在最近打开的activity列表里

android:exported

是否允许activity被其它程序调用

android:finishOnTaskLaunch

当用户重新启动这个任务的时候,是否关闭已打开的activity

android:hardwareAccelerated

是否启用硬件加速

android:icon

图标。值为图片资源

android:label

为用户呈现的可视化标签。

android:launchMode

activity启动方式,值如下:

"standard
"singleTop
"singleTask
"singleInstance"

默认的模式是 "standard".

Use Cases Launch Mode Multiple Instances? Comments
Normal launches for most activities "standard" Yes Default. The system always creates a new instance of the activity in the target task and routes the intent to it.
"singleTop" Conditionally If an instance of the activity already exists at the top of the target task, the system routes the intent to that instance through a call to itsonNewIntent() method, rather than creating a new instance of the activity.
Specialized launches
(not recommended for general use)
"singleTask" No The system creates the activity at the root of a new task and routes the intent to it. However, if an instance of the activity already exists, the system routes the intent to existing instance through a call to its onNewIntent()method, rather than creating a new one.
"singleInstance" No Same as "singleTask", except that the system doesn't launch any other activities into the task holding the instance. The activity is always the single and only member of its task.

android:multiprocess

activity 能否运行在启动他的组件里

android:name

ancivity的名字,实现了activity的类的名字

android:noHistory

当用户切换到其他屏幕时,是否需要移除这个activity。

android:parentActivityName

这个activity的逻辑父类的类名称。

android:permission

运行这个acitvity需要的权限

android:process

一个activity运行时所在的进程名,所有程序组件运行在应用程序默认的进程中,这个进程名跟应用程序的包名一致。

android:screenOrientation

activity显示的模式【方向】

The value can be any one of the following strings:

"unspecified" The default value. The system chooses the orientation. The policy it uses, and therefore the choices made in specific contexts, may differ from device to device.
"user" The user's current preferred orientation.
"behind" The same orientation as the activity that's immediately beneath it in the activity stack.
"landscape" Landscape orientation (the display is wider than it is tall).
"portrait" Portrait orientation (the display is taller than it is wide).
"reverseLandscape" Landscape orientation in the opposite direction from normal landscape.Added in API level 9.
"reversePortrait" Portrait orientation in the opposite direction from normal portrait. Added in API level 9.
"sensorLandscape" Landscape orientation, but can be either normal or reverse landscape based on the device sensor. Added in API level 9.
"sensorPortrait" Portrait orientation, but can be either normal or reverse portrait based on the device sensor. Added in API level 9.
"sensor" The orientation is determined by the device orientation sensor. The orientation of the display depends on how the user is holding the device; it changes when the user rotates the device. Some devices, though, will not rotate to all four possible orientations, by default. To allow all four orientations, use "fullSensor".
"fullSensor" The orientation is determined by the device orientation sensor for any of the 4 orientations. This is similar to "sensor" except this allows any of the 4 possible screen orientations, regardless of what the device will normally do (for example, some devices won't normally use reverse portrait or reverse landscape, but this enables those). Added in API level 9.
"nosensor" The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display will not rotate based on how the user moves the device. Except for this distinction, the system chooses the orientation using the same policy as for the "unspecified" setting.

android:stateNotNeeded

activity被销毁和成功重启是否不保存状态

android:taskAffinity

activity的亲属关系, 默认情况同一个应用程序下的activity有相同的关系

android:theme

activity的样式主题, 如果没有设置,则activity的主题样式从属于应用程序

android:uiOptions

activity'的UI的额外属性.通常有以下赋值:

Value Description
"none" No extra UI options. This is the default.
"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:windowSoftInputMode

activity主窗口与软键盘的交互模式

<activity android:windowSoftInputMode="stateVisible|adjustResize" . . . >
Value Description
"stateUnspecified" The state of the soft keyboard (whether it is hidden or visible) is not specified. The system will choose an appropriate state or rely on the setting in the theme.

This is the default setting for the behavior of the soft keyboard.

"stateUnchanged" The soft keyboard is kept in whatever state it was last in, whether visible or hidden, when the activity comes to the fore.
"stateHidden" The soft keyboard is hidden when the user chooses the activity — that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity.
"stateAlwaysHidden" The soft keyboard is always hidden when the activity's main window has input focus.
"stateVisible" The soft keyboard is visible when that's normally appropriate (when the user is navigating forward to the activity's main window).
"stateAlwaysVisible" The soft keyboard is made visible when the user chooses the activity — that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity.
"adjustUnspecified" It is unspecified whether the activity's main window resizes to make room for the soft keyboard, or whether the contents of the window pan to make the currentfocus visible on-screen. The system will automatically select one of these modes depending on whether the content of the window has any layout views that can scroll their contents. If there is such a view, the window will be resized, on the assumption that scrolling can make all of the window's contents visible within a smaller area.

This is the default setting for the behavior of the main window.

"adjustResize" The activity's main window is always resized to make room for the soft keyboard on screen.
"adjustPan" The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.

[android] AndroidManifest.xml - 【 manifest -> Application -> activity 】的更多相关文章

  1. [android] AndroidManifest.xml - 【 manifest -> application】

    语法: <application android:allowTaskReparenting=["true" | "false"] android:back ...

  2. [android] AndroidManifest.xml -【manifest】

    <manifest> 原文链接:http://www.android-doc.com/guide/topics/manifest/manifest-element.html 最早引入的AP ...

  3. [android] AndroidManifest.xml - 【 manifest -> 其他次要配置】

    <uses-sdk> 作用:使应用程序的兼容性更好,指明应用程序需要的最小API,编译API以及最大支持的API.值都是整数 <uses-sdk android:minSdkVers ...

  4. [android] AndroidManifest.xml - 【 manifest -> permission】

    在  API Level 1 时被引入 语法: <permission android:description="string resource" android:icon= ...

  5. [android] AndroidManifest.xml【 manifest -> uses-permission】

    在  API Level 1 时被引入 简介: 在某些情况下,你为app设置的权限将会影响到google应用商店会用何种规则来过滤你的APP. 如果你需要一个硬件相关的权限——CAMERA,googl ...

  6. [android] AndroidManifest.xml【 manifest -> permission-tree 和 manifest -> permission-group】

    permission-tree 权限树 <permission-tree android:icon="drawable resource" android:label=&qu ...

  7. android AndroidManifest.xml 属性详细解析

    一.关于AndroidManifest.xml AndroidManifest.xml 是每个android程序中必须的文件.它位于整个项目的根目录,描述了package中暴露的组件(activiti ...

  8. Android AndroidManifest.xml详解

    AndroidManifest.xml简述: AndroidManifest.xml 是每个android程序中必须的文件.它位于整个项目的根目录,描述了package中暴露的组件(activitie ...

  9. Android AndroidManifest.xml配置文件

    AndroidManifest.xml配置文件介绍本质:AndroidManifest.xml是整个应用的主配置清单文件.包含:该应用的包名.版本号.组件.权限等信息.作用:记录该应用的相关配置信息. ...

随机推荐

  1. Office WPS PPT如何微量调整文本框的位置

    按住Alt键,用鼠标拖动文本框即可以进行微调.    

  2. angularjs中ajax请求时传递参数的方法

    method1方法使用的是params参数,该用法会把参数直接附加到url中 method2方法使用的是data参数,该参数会把页面参数类型从默认的multipart/form-data改为appli ...

  3. STL - 移除(remove)和释放(erase)集合元素

    remove(移除): 这个操作并不是真正地删除元素,它会移除指定的元素,然后后面的元素依次前移,最后用别的元素来补充. erase(释放): 这个操作会指定释放区间的头和尾迭代器(iterator) ...

  4. [置顶] 深入浅出Spring(四) Spring实例分析

    上次的博文中 深入浅出Spring(二) IoC详解 和 深入浅出Spring(三) AOP详解中,我们分别介绍了一下Spring框架的两个核心一个是IoC,一个是AOP.接下来我们来做一个Sprin ...

  5. zoj3662Math Magic

    Math Magic Time Limit: 3 Seconds       Memory Limit: 32768 KB Yesterday, my teacher taught us about ...

  6. Quartz.Net的使用(简单配置方法)定时任务框架

    Quartz.dll 安装nuget在线获取dll包管理器,从中获取最新版 Quartz.Net是一个定时任务框架,可以实现异常灵活的定时任务,开发人员只要编写少量的代码就可以实现“每隔1小时执行”. ...

  7. Java基础语法(第1章变量)

    今日内容介绍 1.变量 2. 运算符   变量 1.1.变量概述 前面我们已经学习了常量,接下来我们要学习变量.在Java中变量的应用比常量的应用要多很多.所以变量也是尤为重要的知识点! 什么是变量? ...

  8. 解决Fiddler不能监听Java HttpURLConnection请求的方法

    在默认情况下,Fiddler不能监听Java HttpURLConnection请求.究其原因,Java的网络通信协议栈可能浏览器的通信协议栈略有区别,Fiddler监听Http请求的原理是 在应用程 ...

  9. Unity WP8开发环境

    Unity WP8开发环境   VS2012旗舰版: 安装WP SDK8.0出错提示: 根据当前系统时钟或签名文件中的时间戳验证时要求的证书不在有效期内 解决办法: 方法一:把操作系统的时间日期调整到 ...

  10. Redis源代码剖析和凝视(八)--- 对象系统(redisObject)

    Redis 对象系统 1. 介绍 redis中基于双端链表.简单动态字符串(sds).字典.跳跃表.整数集合.压缩列表.高速列表等等数据结构实现了一个对象系统,而且实现了5种不同的对象,每种对象都使用 ...