android - 旋转三星手机时应用程序崩溃

标签 android cordova

有没有其他人遇到过手机旋转时应用程序崩溃的情况? 我在我的 Samsung Galaxy 2 上运行 Android 4.0.3。

运行 Android 2.3.3 的 HTC 或 Samsung 不会出现此问题。

Eclipse 调试屏幕未显示任何错误。

我的应用是使用 PhoneGap 开发的。

当我旋转手机时记录:

05-25 13:38:09.155: I/GATE(20061): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
05-25 13:38:09.175: D/DroidGap(20061): Origin to allow: http://127.0.0.1*
05-25 13:38:09.175: I/CordovaLog(20061): Found log level DEBUG
05-25 13:38:09.175: I/CordovaLog(20061): Changing log level to DEBUG(3)
05-25 13:38:09.175: I/CordovaLog(20061): Found preference for classicRender
05-25 13:38:09.175: D/DroidGap(20061): DroidGap.onCreate()
05-25 13:38:09.180: D/DroidGap(20061): DroidGap.loadUrl(file:///android_asset/www/index.html)
05-25 13:38:09.180: D/DroidGap(20061): DroidGap: url=file:///android_asset/www/index.html baseUrl=file:///android_asset/www/
05-25 13:38:09.205: I/webclipboard(20061): clipservice: android.sec.clipboard.ClipboardExManager@4169fae8
05-25 13:38:09.210: D/DroidGap(20061): DroidGap.init()
05-25 13:38:09.260: D/PluginManager(20061): init()
05-25 13:38:09.280: D/WML_SISO(20061): InitPasteboardJni
05-25 13:38:09.280: D/SoftKeyboardDetect(20061): Ignore this event
05-25 13:38:09.730: W/IInputConnectionWrapper(20061): showStatusIcon on inactive InputConnection
05-25 13:38:09.790: I/GATE(20061): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
05-25 13:38:09.810: I/GATE(20061): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>

最佳答案

您需要将 screenSize 添加到 Activity 的 android:configChanges 属性,并至少针对 android-13 目标进行构建,因为该值是在 API 级别 13 中引入的。

关于android - 旋转三星手机时应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10753600/

相关文章:

php - 如何使用 Php 将我的 Android 应用程序连接到 Amazon RDS MySQL 数据库?

android - 无法使用 Cordova 插件在 Android Studio 中编译 Cordova 项目

cordova - AWS S3 签名 url 编码结果 "SignatureDoesNotMatch"

android - 来自共享链接的 Dropbox 文件元数据

android - 如何在 android 中实现 Exoplayer 2.11.1?

android - 迁移到 Play Services v7.5+ 的新 GCM 协议(protocol)时,无法解析 AndroidManifest.xml 中的 'gcm'

android - 在 Android 模拟器中显示韩语(不支持 MacRoman)

android - ChatHead 服务在 Nexus 设备上的 Lollipop 和 Marshmallow 中不工作

android - 在 Phonegap 中集成闪屏时出错

javascript - 如何使用文件系统(HTML5)访问/探索远程(服务器)文件?