AndroidManifest.xml补充之:andorid:configChanges

FROM:http://blog.csdn.net/shift_wwx/article/details/19488771

Android:configChanges

Lists configuration changes that the activity will handle itself. When a configurationchange occurs at runtime, the activity is shut down and restarted by default, but declaring aconfiguration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and itsonConfigurationChanged() method is called.

Note: Using this attribute should be avoided and used only as a last resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change.

Any or all of the following strings are valid values for this attribute. Multiple values are separated by '|' — for example, "locale|navigation|orientation".

通过上面介绍获悉:

当配置list中有发生修改时,activity会自动的结束并重启,但是不会从onCreate 和 onRestart,而是从onConfigurationChanged()开始。

list中的配置是用符号“|”来分隔。


android:configChanges=["mcc", "mnc", "locale",
                                 "touchscreen", "keyboard", "keyboardHidden",
                                 "navigation", "screenLayout", "fontScale", "uiMode",
                                 "orientation", "screenSize", "smallestScreenSize"]

mmc:The IMSI mobile country code (MCC) has changed — a SIM has been detected and updated the MCC.

               移动国家号码,由三位数字组成,每个国家都有自己独立的MCC,可以识别手机用户所属国家。

mnc  :The IMSI mobile network code (MNC) has changed — a SIM has been detected and updated the MNC.

               移动网号,在一个国家或者地区中,用于区分手机用户的服务商。

local: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 thedevice into a desk/car dock or when the night mode changes. SeeUiModeManagerAdded 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 (asdeclared by theminSdkVersion and targetSdkVersion attributes), then you should also declare the"screenSize"configuration, because it also changes when a device switches between portrait and land scape orientations.

                设备旋转,横向显示和竖向显示模式切换。note中显示API level大于13的话要申明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 oforientation, 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, thenyour activity always handles this configuration change itself (this configuration change does notrestart 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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值