Phonegap(科尔多瓦)。如果我双击“返回”按钮,则应用程序崩溃

时间:2012-11-09 16:43:37

标签: android cordova

如果我双击Android设备上的“返回”按钮,则应用程序崩溃。

我的应用程序使用JQuery Mobile和Phonegap 2.0(Cordova)构建。

我遇到了这个问题。 我将焦点放在页面上的任何INPUT字段,以便显示键盘。 我双击设备上的“返回”按钮。 预计:应用程序返回到我访问过的上一页。 实际:应用程序崩溃

Eclipse Log Cat在发生时显示下一条消息:

11-09 18:20:04.175: D/SoftKeyboardDetect(7399): Ignore this event
11-09 18:20:04.597: D/dalvikvm(136): GC_FOR_ALLOC freed 502K, 11% free 15278K/17159K, paused 149ms
11-09 18:20:04.632: D/CordovaWebView(7399): >>> loadUrlNow()
11-09 18:20:04.675: D/SoftKeyboardDetect(7399): Ignore this event
11-09 18:20:04.707: W/InputManagerService(136): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub

$Proxy@414c0dc0 (uid=10008 pid=7399)
11-09 18:20:04.707: W/InputManagerService(136): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub

$Proxy@414c0dc0 (uid=10008 pid=7399)
11-09 18:20:04.711: W/IInputConnectionWrapper(7399): showStatusIcon on inactive InputConnection
11-09 18:20:04.925: D/OpenGLRenderer(7399): Flushing caches (mode 0)
11-09 18:20:04.988: D/dalvikvm(202): GC_CONCURRENT freed 869K, 32% free 10761K/15623K, paused 2ms+22ms
11-09 18:20:05.425: D/OpenGLRenderer(7399): Flushing caches (mode 1)
11-09 18:20:05.429: D/DroidGap(7399): onDestroy()
11-09 18:20:05.429: D/CordovaWebView(7399): >>> loadUrlNow()
11-09 18:20:05.433: D/CordovaWebView(7399): >>> loadUrlNow()
11-09 18:20:05.457: D/DroidGap(7399): onMessage(onPageStarted,about:blank)
11-09 18:20:05.476: D/Cordova(7399): onPageFinished(about:blank)
11-09 18:20:05.476: D/DroidGap(7399): onMessage(onPageFinished,about:blank)
11-09 18:20:05.476: D/DroidGap(7399): onMessage(exit,null)

有人可以帮我解决这个问题吗?

提前致谢。

3 个答案:

答案 0 :(得分:0)

如果我正确解释,页面左上角的按钮是UP按钮,而不是Back。它应该是你的应用程序的图标,左角括号。 见Implementing Ancestral Navigation

答案 1 :(得分:0)

我已经解决了这个问题。 解决方案是将Phonegap更新为2.2版,并为后退按钮事件中的所有“输入”文本字段绑定“模糊”。 谢谢大家的时间。

答案 2 :(得分:0)

使用此CSS作为修复:它解决了我的问题。

input {
-webkit-user-modify: read-write-plaintext-only
}