android - 设置 targetSdkVersion ="13"导致 Activity 忽略 android :configChanges ="orientation" flag

标签 android android-3.0-honeycomb orientation-changes

API 级别 13 似乎(据我所知“悄悄地”)引入了对 android:configChanges 属性处理方式的更改。

在我的特殊情况下,当应用程序 list 中的“targetSdkVersion”设置为“13”时,任何配置为内部处理方向更改的 Activity (例如,不应在屏幕旋转时重新启动)总是重新启动,而不管 android :configChanges="orientation"属性在他们的声明中。

将“targetSdkVersion”简单切换为“12”即可恢复预期行为。

我搜索了 API 13 发行说明,但找不到任何提及此类更改的内容。有谁知道 API 13(可能还有更高版本的 API)是否会在设计上不支持 android:configChanges="orientation",或者是否有另一种方法可以实现这一点。

最佳答案

看起来有一些关于 configChanges 的新文档,具体指 HONEYCOMB_MR2 版本。也许您可以尝试使用 orientation|screenSize|smallestScreenSize,看看是否会改变行为。希望至少能引导您朝着正确的方向前进。

关于android - 设置 targetSdkVersion ="13"导致 Activity 忽略 android :configChanges ="orientation" flag,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6848637/

相关文章:

android - onCreateView() 中 getWidth() 返回 0

android - 不同 session 中 PWA 的可信 Web Activity

android - 使用 Android 测试过滤器(@SmallTest、@MediumTest、@LargeTest)进行本地单元测试

android - 如何打开由 eclipse(android) 形式 DDMS-->File explorer-->data--->data-->packagename-->database 生成的 .db 文件?

android - MPAndroidChart 中的可滚动折线图

android - 是否可以使用 Honeycomb (Android 3.0) 从平板电脑运行 R?

java - Intent.putExtras 大小限制?

具有不同主题的 Android 应用程序和 Actionbar

android - 当进度条在android中旋转时如何停止改变方向

ios - 在使用appium时,我们如何将设备方向更改为横向模式?