你的位置:首页 > 软件开发 > 操作系统 > android:configChanges不被调用的问题

android:configChanges不被调用的问题

发布时间:2015-07-13 21:00:24
同样是由于SDK版本引发的问题。版本高的更加严谨,限制更多。"orientation"The screen orientation has changed — the user has rotated the device.Note: ...

同样是由于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 the minSdkVersion and targetSdkVersion attributes), 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.

 

 

 

 

 

 

 

 

So,大意就是SDK版本13或以上的,需要同时用orientation与screenSize。因为当设备横竖屏切换时,相应的屏幕大小也改变了。所以在Activity配置中正确写法为

android:configChanges="orientation|screenSize"

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:android:configChanges不被调用的问题

关键词:Android

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录