原文地址:android:configChanges 作者:夏止忧伤

android中的组件Activity在manifest.xml文件中可以指定参数android:ConfigChanges,用于捕获手机状态的改变。在Activity中添加了android:configChanges属性,在当所指定属性(Configuration Changes)发生改变时,通知程序调用onConfigurationChanged()函数。
设置方法:将下列字段用“|”符号分隔开,例如:“locale|navigation|orientation

Value

Description

mcc

The IMSI mobile country code (MCC) has changed — that is, a SIM hasbeen detected and updated the MCC.移动国家号码,由三位数字组成,每个国家都有自己独立的MCC,可以识别手机用户所属国家。

mnc

The IMSI mobile network code (MNC) has changed — that is, a SIM hasbeen detected and updated the MNC.移动网号,在一个国家或者地区中,用于区分手机用户的服务商。

locale

The locale has changed — for example, 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 slid the keyboard out to expose it.用户打开手机硬件键盘

navigation

The navigation type has changed. (This should never normally happen.)

orientation

The screen orientation has changed — that is, the user has rotated the device.设备旋转,横向显示和竖向显示模式切换。

fontScale

The font scaling factor has changed — that is, the user has selected a new global font size.全局字体大小缩放发生改变

因为有些手机不配置这一项的话,在状态发生改变的时候,会容易报错。

更多相关文章

  1. Android(安卓)Contextual Menus之二:contextual action mode
  2. Android(安卓)Wear Preview - UI
  3. [Android(安卓)UI界面] Android(安卓)UI 设计准则
  4. Android将允许纯C/C++开发应用(上)
  5. Android(安卓)适配---notification led 呼吸灯
  6. Android应用程序的类型
  7. 点击LinearLayout使用selector改变TextView字体颜色
  8. Android——RatingBar(评价条)相关知识总结贴
  9. Android(安卓)代码改变图片颜色android:tint="@color/main_color

随机推荐

  1. Web Components系列(一) —— 概述
  2. 【北亚数据恢复】MongoDB数据迁移过程中
  3. Chrome浏览器配置阿里云DNS方法
  4. PHP的8种数据变量、for&foreach循环语句
  5. 复制mysql数据表里的多条记录,并插入表里
  6. VueRouter报错:NET::ERR_ABORTED 404
  7. CentOS 8 EOL如何切换源?
  8. 【北亚数据恢复】MSSQL 2000 提示“错误
  9. 云服务器安全吗?如何设置?
  10. 官方镜像加速