有没有其他人遇到过手机旋转时应用程序崩溃的情况? 我在我的 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/