旧设备和AndroidManifest configChanges"屏幕尺寸" [英] Older devices and AndroidManifest configChanges "screenSize"

查看:258
本文介绍了旧设备和AndroidManifest configChanges"屏幕尺寸"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

引用文档:

注意:与Android 3.2(API等级13),在屏幕尺寸开始
  当设备纵向和横向之间切换也改变
  方向。因此,如果你想prevent运行时重新启动因
  对于API级别13或更高的发展方向变化时(如
  由申报的minSdkVersion和targetSdkVersion属性),你
  必须包含除在屏幕尺寸价值的方向
  值。也就是说,你必须decalare
  机器人:configChanges =方向|屏幕尺寸

Caution: Beginning with Android 3.2 (API level 13), the "screen size" also changes when the device switches between portrait and landscape orientation. Thus, if you want to prevent runtime restarts due to orientation change when developing for API level 13 or higher (as declared by the minSdkVersion and targetSdkVersion attributes), you must include the "screenSize" value in addition to the "orientation" value. That is, you must decalare android:configChanges="orientation|screenSize"

我需要忽略屏幕尺寸配置的变化。我最小的SDK级别为8(Android 2.2的),以及目标SDK水平是13。因此,我需要在manifest介绍吧。

I need to ignore the screenSize config change. My minimum SDK level is 8 (Android 2.2), and target SDK level is 13. Therefore, I need to introduce it in the manifest.

但是,Eclipse不认识它,因为它的Andr​​oid的设置为2.2。所以,我把它改成了应有的水平,而现在它建立正常。

However, Eclipse doesn't recognize it, because its Android setting is set to 2.2. So I've changed it to the proper level, and now it builds properly.

我很害怕,但是,有将是旧版本,其中屏幕尺寸配置变化尚不可用的问题。 (例如,当应用程序被运行在Android 2.2设备。)也就是说,当它读取清单中的应用程序会崩溃,因为屏幕尺寸将是它的一个值未知。还是会简单地忽略它放在pre-3.2的设备?

I'm afraid, however, that there will be issues on older versions where the screenSize config change wasn't yet available. (E.g. when the app is run on Android 2.2. device.) That is, the application will crash when it reads the manifest, because screenSize will be an unknown value for it. Or will it simply ignore it on pre-3.2 devices?

P.S:我没有现在测试它在真实设备上的机会,我不会在这样一个关键的事情单独信任模拟器。

P.S.: I don't have the chance to test it on a real device now, and I wouldn't trust the emulator alone in such a critical matter.

推荐答案

它会忽略它。同样是分屏操作栏和其他东西,类似如此。不像在Java中,任何事物的Andr​​oid操作系统不会从它本质上忽略了明显的理解。

It will ignore it. Same is true for splitscreen action bar and other things that are similar. Unlike in java, any things the android os doesn't understand from the manifest it essentially ignores.

这篇关于旧设备和AndroidManifest configChanges"屏幕尺寸"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆