android:launchMode,即Activity的启动模式,与Intent中的Flags共同作用,决定Activity如何启动。

android:launchMode分别有"standard", "singleTop", "singleTask", "singleInstance".

"standard": 每次都创建新的实例;

"singleTop": 如果目标Task的顶端是就是对应的实例,那么这个实例将会接受新的Intent;否则,创建新的实例;

"singleTask": 同一个Task中只允许存在一个实例,而且这个实例必须在该Task的Activity堆栈的低端,允许其他Activity实例存在;

"singleInstance": 同一个Task中只允许存在一个实例,而且不允许其他Activity实例存在。

android:configChanges

当一些配置发生改变时,Activity将会关闭,然后重启,但是配置了这个选项,可以捕获配置改变的事件,从而避免Activity重启。

可捕获的事件如:

Value Description
"mcc" The IMSI mobile country code (MCC) has changed — a SIM has been detected and updated the MCC. 系统监测到SIM卡之后,会更新MCC。
"mnc" The IMSI mobile network code (MNC) has changed — a SIM has been detected and updated the MNC. 系统监测到SIM卡之后,会更新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 night mode changes. See UiModeManagerAdded in API level 8. 系统uiMode发生改变,如进入夜视模式。
"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. 当你的应用目标API Level大于等于13时,应该同时声明screenSize配置,因为screenSize在切换横/纵向时改变的。

"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 the smallestWidth 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.

"layoutDirection" The layout direction has changed. For example, changing from left-to-right (LTR) to right-to-left (RTL). Added in API level 17.布局方向发生改变。

android开发——学习总结20131204的更多相关文章

  1. Android开发学习之路-RecyclerView滑动删除和拖动排序

    Android开发学习之路-RecyclerView使用初探 Android开发学习之路-RecyclerView的Item自定义动画及DefaultItemAnimator源码分析 Android开 ...

  2. Android开发学习路线图

    Android开发学习方法: Android是一个比较庞大的体系,从底层的Linux内核到上层的应用层,各部分的内容跨度也比较大.因此,一个好的学习方法对我们学习Android开发很重要. 在此建议, ...

  3. android开发学习笔记000

    使用书籍:<疯狂android讲义>——李刚著,2011年7月出版 虽然现在已2014,可我挑来跳去,还是以这本书开始我的android之旅吧. “疯狂源自梦想,技术成就辉煌.” 让我这个 ...

  4. Android开发学习总结(一)——搭建最新版本的Android开发环境

    Android开发学习总结(一)——搭建最新版本的Android开发环境(转) 最近由于工作中要负责开发一款Android的App,之前都是做JavaWeb的开发,Android开发虽然有所了解,但是 ...

  5. Android开发学习之LauncherActivity开发启动的列表

    Android开发学习之LauncherActivity开发启动的列表 创建项目:OtherActivity 项目运行结果:   建立主Activity:OtherActivity.java [jav ...

  6. 最实用的Android开发学习路线分享

    Android开发学习路线分享.Android发展主导移动互联发展进程,在热门行业来说,Android开发堪称火爆,但是,虽然Android有着自身种种优势,但对开发者的专业性要求也是极高,这种要求随 ...

  7. Android开发学习必备的java知识

    Android开发学习必备的java知识本讲内容:对象.标识符.关键字.变量.常量.字面值.基本数据类型.整数.浮点数.布尔型.字符型.赋值.注释 Java作为一门语言,必然有他的语法规则.学习编程语 ...

  8. Android开发学习之路--基于vitamio的视频播放器(二)

      终于把该忙的事情都忙得差不多了,接下来又可以开始good good study,day day up了.在Android开发学习之路–基于vitamio的视频播放器(一)中,主要讲了播放器的界面的 ...

  9. Android开发学习之路--Android Studio cmake编译ffmpeg

      最新的android studio2.2引入了cmake可以很好地实现ndk的编写.这里使用最新的方式,对于以前的android下的ndk编译什么的可以参考之前的文章:Android开发学习之路– ...

随机推荐

  1. [HTML5]HTML结构性元素(Structure)

    参考自:http://techbrood.com/h5b2a?p=html-structure 结构性元素用来组织文档的各个部分 为了让文档层次分明,我们可以把文档中的元素按其内容的作用进行组合,这就 ...

  2. OAF_开发系列20_实现OAF打印功能

    ddddd 添加一个页面级的button区域:pagebuttonBar,在之下添加button item ,这里主要设置的参数有:采用默认的oaf的打印按钮的id名称: IcxPrintablePa ...

  3. codeforces 练习

    codeforces 627 D. Preorder Test 二分 + 树dp 做logn次树dp codeforces 578D.LCS Again 给出一个字符串str,长度n<=10^6 ...

  4. Java 判断文件夹、文件是否存在、否则创建文件夹

    1.判断文件是否存在,不存在创建文件 File file=new File("C:\\Users\\QPING\\Desktop\\JavaScript\\2.htm"); if( ...

  5. mysql数据备份

    转载自:http://blog.chinaunix.net/uid-16480950-id-102800.html   http://www.cnblogs.com/xuejie/archive/20 ...

  6. 开启win7系统关闭日志分析

    笔记本突然没有任何征兆的自动重启了,想起之前曾经在网上看过通过系统日志查看一下是哪个东东搞的鬼,于是开始上网搜索,发现默认情况下是关机的信息记录的很少,不过可以开启审计功能来记录这个捣鬼的程序.于是就 ...

  7. Android 通过广播获取网络状态

    Android系统网络连接状态的改变会发一个广播,注册一个广播接收者,实时动态的检测网络状态,及时提醒用户,优化用户体验.          本文仅提供WIFI 状态的检测作为参考,其他网络连接方式请 ...

  8. Java File.renameTo方法的问题

    今天发现一个问题,renameTo执行失败. 程序是这样的:一个小程序在执行完成时会将A目录的文件renameTo到B目录,该程序一直运行正常.今天将B目录进行了mount挂载(Linux上),挂载后 ...

  9. SQL Server 2014 SP2发布下载:数十项更新修复

    微软发布了数据库工具SQL Server 2014 SP2服务包下载,本次更新集合了数十项更新修复,涉及安全和功能性补丁,使用SQL Server 2014的用户应该及时安装该服务包. 文件内容 版本 ...

  10. [手机取证] “神器”IP-BOX的一些问题

    网上最近传的纷纷扬扬的iOS密码破解神器IP-BOX,很多人感兴趣,作为一个该产品的老用户,来破除一下迷信,顺便做个普及~ Q1:这东西好神奇,是不是所有都能破解? A1:支持简单密码的穷举,有条件的 ...