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 its onConfigurationChanged() 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. SeeUiModeManager. Added 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.



更多相关文章

  1. Android监控软键盘变化实例
  2. android 键盘弹起 UI上移
  3. Android 打开软键盘
  4. Android键盘操作响应
  5. Android 软键盘控制弹出(很好使,自己写的,绝对能用)
  6. android键盘隐藏
  7. Android应用程序键盘(Keyboard)消息处理机制分析(一)
  8. Android软键盘-弹起时布局向上拉-多表单填写界面
  9. EditText 键盘收回

随机推荐

  1. Android仿微信5实现滑动导航条
  2. Android:手机信息的发送
  3. Android 一个程序A启动程序B
  4. 如何获取Android IP地址
  5. Bugly对应用进行升级
  6. android点击屏幕隐藏小键盘
  7. android 使用imageloader 获取图片时,如果
  8. Android 知识点收藏
  9. 为android写的一个UDP Socket连接组件
  10. Android——常用代码段积累(一)