android开发——学习总结20131204
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 UiModeManager. Added 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 |
"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的更多相关文章
- Android开发学习之路-RecyclerView滑动删除和拖动排序
Android开发学习之路-RecyclerView使用初探 Android开发学习之路-RecyclerView的Item自定义动画及DefaultItemAnimator源码分析 Android开 ...
- Android开发学习路线图
Android开发学习方法: Android是一个比较庞大的体系,从底层的Linux内核到上层的应用层,各部分的内容跨度也比较大.因此,一个好的学习方法对我们学习Android开发很重要. 在此建议, ...
- android开发学习笔记000
使用书籍:<疯狂android讲义>——李刚著,2011年7月出版 虽然现在已2014,可我挑来跳去,还是以这本书开始我的android之旅吧. “疯狂源自梦想,技术成就辉煌.” 让我这个 ...
- Android开发学习总结(一)——搭建最新版本的Android开发环境
Android开发学习总结(一)——搭建最新版本的Android开发环境(转) 最近由于工作中要负责开发一款Android的App,之前都是做JavaWeb的开发,Android开发虽然有所了解,但是 ...
- Android开发学习之LauncherActivity开发启动的列表
Android开发学习之LauncherActivity开发启动的列表 创建项目:OtherActivity 项目运行结果: 建立主Activity:OtherActivity.java [jav ...
- 最实用的Android开发学习路线分享
Android开发学习路线分享.Android发展主导移动互联发展进程,在热门行业来说,Android开发堪称火爆,但是,虽然Android有着自身种种优势,但对开发者的专业性要求也是极高,这种要求随 ...
- Android开发学习必备的java知识
Android开发学习必备的java知识本讲内容:对象.标识符.关键字.变量.常量.字面值.基本数据类型.整数.浮点数.布尔型.字符型.赋值.注释 Java作为一门语言,必然有他的语法规则.学习编程语 ...
- Android开发学习之路--基于vitamio的视频播放器(二)
终于把该忙的事情都忙得差不多了,接下来又可以开始good good study,day day up了.在Android开发学习之路–基于vitamio的视频播放器(一)中,主要讲了播放器的界面的 ...
- Android开发学习之路--Android Studio cmake编译ffmpeg
最新的android studio2.2引入了cmake可以很好地实现ndk的编写.这里使用最新的方式,对于以前的android下的ndk编译什么的可以参考之前的文章:Android开发学习之路– ...
随机推荐
- 挖掘微信Web版通信的全过程 [转]
昨天是周末,在家闲得无聊,于是去weiphone.com逛了一圈,偶然发现有人发了一帖叫<微信 for Mac>, 这勾起了我的好奇心,国内做Mac开发的人确实很少,对于那些能够独自开发一 ...
- Node.js文件系统、路径的操作详解
17173 17173 2 75 2014-12-12T05:06:00Z 2014-12-12T05:06:00Z 21 2735 15595 www.17173.com 129 36 18294 ...
- js正则表达式学习
//几种字符串操作:var str = 'abcdef'; alert(str.search('b')); //弹出1:返回的是b在str中的位置:如果找不到返回-1: alert(str.subst ...
- iOS5.0以上使用新浪微博开放平台OAuth 续(及解决登录无效问题)
新浪微博开放平台为第三方应用提供了简便的合作模式,满足了手机用户和平板电脑用户随时随地分享信息的需求.通过调用平台的api即可实现很多微博上的功能. 本篇主要目的是记录新浪微博移动SDK iOS版本的 ...
- Andriod中textview垂直水平居中及LinearLayout内组件的垂直布局
1.textview 垂直水平居中的设置 Android:gravity="center_vertical|center" 2.LinearLayout中设置控件垂直布局,默认的是 ...
- 剑指Offer:面试题31——连续子数组的最大和(java实现)
问题描述 : 输入一个整数数组,数组里面有正数也有负数.数组中一个或连续几个整数组成一个子数组.求所有子数组的和的最大值.要求时间复杂度为O(n) 思路1:常规解法,不知道怎么描述了.. 代码: bo ...
- C#TreeView控件遍历文件夹下所有子文件夹以及文件
一直对递归的理解不深刻,有时候觉得很简单,可是用起来总会出错.这里需要在TreeView控件里显示一个文件夹下的所有目录以及文件,毫无意外的需要用到递归. 一开始,想到用递归写一个生成每一个节点(Tr ...
- SQL存储过程解密
首先要建立一张表和一个存储过程: SQL_DECODE表: CREATE TABLE [dbo].[SQL_DECODE]( ,) NOT NULL, [SQLTEXT] [nvarchar](max ...
- extends 和 implements
extends是继承类与类的 implements是实现接口的 类与类之间只支持单继承 接口与接口之间支持多继承
- Oracle诡异结果调查备忘 - A investigation memo of weird Oracle database search results
最近需要维护一个差不多十多年前开发的ASP.Net程序,遇到了各种奇奇怪怪的问题,把其中比较难查明的问题记录如下: 问题一: 同样的SQL查询在不同服务器上查询结果不同.在QA环境下,结果完全正常,而 ...