最近在做4.0项目的时候,遇到activity重新加载问题无法解决,后来研究google源代码,发现里面的android:configchanges已经发生改变,一查sdk文档,果然发现问题所在,如下:

"orientation" The screen orientation has changed — the user has rotated the device.

Note:If your application targets API level 13 or higher (as declared by theminSdkVersionandtargetSdkVersionattributes), then you should also declare the"screenSize"configuration, because it also changes when a device switches between portrait and landscape orientations.

"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.





所以在android 4.0 中,如果想禁止activity重新启动,就需要在android:configchanges中加入scressSize值!

更多相关文章

  1. 解决Android(安卓)studio升级到3.5的一些问题
  2. android ddms查看线程
  3. Android(安卓)JNI编程内存问题定位方法
  4. [置顶] 彻底解决Android(安卓)应用方法数不能超过65K的问题
  5. Android实现开机自启动无效问题
  6. 关于Android使用Google Map Android(安卓)API V2的问题
  7. Android(安卓)Native中Android.mk编译链接时命名冲突的问题
  8. Android(安卓)SDK代理服务器解决国内不能更新下载问题
  9. RecyclerView设置addItemDecoration在Fragment中不显示

随机推荐

  1. android grantRuntimePermission 详解
  2. Android下调用收发短信邮件等
  3. 圆形button
  4. Android自定义对话框(Dialog)位置,大小
  5. Android查询短信数据库 查询联系人数据库
  6. PopupWindow 动画显示与消失(逐惭缩放、逐
  7. 如何在Android设备中用NDK编译SQLite并且
  8. android namespace 、样式、主题 (一)
  9. android 封装好的BottomTabBar
  10. Android实现点击两次返回键退出