安卓的onCreate()方法调用两次当设备旋转。 (ICS) [英] Android onCreate() Method called twice when device rotated. (ICS)

查看:180
本文介绍了安卓的onCreate()方法调用两次当设备旋转。 (ICS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发在Android平板电脑应用程序,我需要管理的应用方向。我每一次当我旋转设备的onCreate(将被称为一个问题)。

I'm developing on an android tablet application and I have to manage application orientation. I got a problem that every time when I rotate the device onCreate() will be called.

我固定在蜂窝(3.1)这个问题,通过设置该行Manifest.xml文件在活动标记,它工作得很好。

I fixed this problem on Honeycomb (3.1) by set this line in Manifest.xml file at the activity tag and it works well.

          android:configChanges="keyboardHidden|orientation"

但这个问题又回来了,当我测试我的ICS平板电脑的应用程序。有谁知道如何解决这个问题?

But this problem came back again when I test my app on ICS Tablet. Does anyone know how to fix this problem?

感谢

问候。

推荐答案

如果你的目标是 API级> 13 您必须添加屏幕尺寸标志作为报告的文档:

If you are targeting an API level > 13 you have to add the screenSize flag as reported in the doc:

  android:configChanges="keyboardHidden|orientation|screenSize"

这篇关于安卓的onCreate()方法调用两次当设备旋转。 (ICS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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