我已经使用 html、css、javascript 和 jquery 创建了 android phonegap 应用程序。当我点击后退按钮时,我的应用程序被强制关闭。我在 logcat 中的错误如下:
ERROR/AndroidRuntime(23383): FATAL EXCEPTION: main
ERROR/AndroidRuntime(23383): android.view.WindowManager
$BadTokenException: Unable to add window -- token
android.os.BinderProxy@48c59828 is not valid; is your activity
running?
at android.view.ViewRoot.setView(ViewRoot.java:505)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:207)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:121)
at android.view.Window$LocalWindowManager.addView(Window.java:424)
at android.app.Dialog.show(Dialog.java:259)
at android.app.AlertDialog$Builder.show(AlertDialog.java:802)
at com.phonegap.DroidGap$GapClient.onJsAlert(DroidGap.java:983)
at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:531)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4632)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:871)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
at dalvik.system.NativeStart.main(Native Method)
ERROR/(1364): Dumpstate > /data/log/dumpstate_app_error
请指导我哪里错了。在此先感谢。