Android 重力感应 翻转页面造成Activity 刷新 。

在 AndroidManifest.xml 中将所属activity 添加android:configChanges="orientation|keyboardHidden" 属性 可禁止刷新

Activity 的 ConfigChanges 属性

设置方法:将下列字段用“|”符号分隔开,例如:“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 5.0多用户支持
  2. android 用户注册demo
  3. 小编程(三):用户登录注册界面开发及用户信息管理案例代码详解
  4. Android用户近60%仍使用2.3版本 4.0版本达20.9%
  5. Android用户版本分布更新 2.1版领先
  6. Android Wi-Fi 修改国家码(QCOM平台)
  7. Android 之 AlertDialog 用户登录
  8. Android用户界面 UI组件--ImageView及其子类ImageButton,QuickCo

随机推荐

  1. 传智播客Android视频教程——第八天
  2. Android .so abi兼容,通用armeabi-v7a和ar
  3. Android怎么判断手机有没有联网
  4. Android 各个版本适配及新功能
  5. Android Studio启动模拟器时老是黑屏,显示
  6. Android 中input学习--取得input事件
  7. android sdcard读取时报错PVMFErrNotSupp
  8. 解决EventBus中接收方法中无法更新UI的问
  9. Android 开发笔记(SDK)
  10. Android View滚动、拉伸到顶/底部弹性回