转载自:http://www.cnblogs.com/carlo/p/4311010.html

一般在AndroidManifest.xml文件中都没有使用到android:configChanges="keyboardHidden|orientation"配置,当然还是很有用的。
就是如果配置了这个属性,当我们横竖屏切换的时候会直接调用onCreate方法中的onConfigurationChanged方法,而不会重新执行onCreate方法,那当然如果不配置这个属性的话就会重新调用onCreate方法了

 

android:configChanges=["mcc", "mnc", "locale",
"touchscreen", "keyboard", "keyboardHidden",
"navigation", "screenLayout", "fontScale", "uiMode",
"orientation", "screenSize", "smallestScreenSize"]
mcc:The IMSI mobile country code (MCC) has changed — a SIM has been detected and updated the MCC.
IMSI(国际移动用户识别码)发生改变,检测到SIM卡,或者更新MCC
mnc:The IMSI mobile network code (MNC) has changed — a SIM has been detected and updated the MNC.
IMSI网络发生改变,检测到SIM卡,或者更新MCC
其中mcc和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.)
导航发生改变,(这通常不应该发生) 举例:连接蓝牙键盘,连接后确实导致了navigation的类型发生变化。因为连接蓝牙键盘后,我可以使用方向键来navigate了
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.
全局字体大小缩放发生改变
orientation:The screen orientation has changed — that is, the user has rotated the device.设备旋转,横向显示和竖向显示模式切换。
screenSize: 屏幕大小改变了
smallestScreenSize: 屏幕的物理大小改变了,如:连接到一个外部的屏幕上
4.2增加了一个layoutDirection属性,当改变语言设置后,该属性也会成newConfig中的一个mask位。所以ActivityManagerService(实际在ActivityStack)在决定是否重启Activity的时候总是判断为重启。
需要在android:configChanges 中同时添加locale和layoutDirection。
在不退出应用的情况下切换到Settings里切换语言,发现该Activity还是重启了。

更多相关文章

  1. android 中的 edittext属性大全
  2. Android学习笔记:androidmanifest.xml 高级属性
  3. android键盘挡住界面
  4. LinearLayout && RelativeLayout 常用属性
  5. Android中自定义属性(attrs.xml,TypedArray的使用)
  6. android 属性系统 及其 补充
  7. Android App监听软键盘按键的方式与改变软键盘右下角确定键样式
  8. Android GridView 特殊属性

随机推荐

  1. Android(安卓)学习教程一 安装eclipse an
  2. 【Android(安卓)界面效果6】Android(安卓
  3. Android(安卓)系统调试接口
  4. 在Eclipse添加Android兼容包(v4/v7appcom
  5. Ubuntu10.04 Android(安卓)开发环境配置
  6. 史上最霸气的android中gradle编写
  7. [置顶] Android多状态组合之位运算(BitMas
  8. Android中实现Gallery 点击放大
  9. Android缓存机制——一般存储实现
  10. ListView.setOnItemClickListener无效