我已经完成了两次这个基本教程来创建一个地图+一个覆盖AndroidMarker(当你点击他时,应该出现一个弹出窗口) 我仍然遇到同样的问题,当我按下标记时,应用程序在dialog.show()上崩溃了。
你能告诉我如何调试这个问题吗?
My sources can be found here(链接已死。请求的主题不存在。)
11-23 12:48:51.364: WARN/WindowManager(59): Attempted to add window with non-application token WindowToken{43f3eb70 token=null}. Aborting.
11-23 12:48:51.384: DEBUG/AndroidRuntime(307): Shutting down VM
11-23 12:48:51.384: WARN/dalvikvm(307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): FATAL EXCEPTION: main
11-23 12:48:51.454: ERROR/AndroidRuntime(307): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.ViewRoot.setView(ViewRoot.java:509)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.app.Dialog.show(Dialog.java:241)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.app.AlertDialog$Builder.show(AlertDialog.java:802)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.markerTest.HelloItemizedOverlay.onTap(HelloItemizedOverlay.java:45)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:347)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.google.android.maps.MapView.onTouchEvent(MapView.java:647)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.View.dispatchTouchEvent(View.java:3766)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.os.Handler.dispatchMessage(Handler.java:99)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.os.Looper.loop(Looper.java:123)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at java.lang.reflect.Method.invokeNative(Native Method)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at java.lang.reflect.Method.invoke(Method.java:521)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-23 12:48:51.454: ERROR/AndroidRuntime(307): at dalvik.system.NativeStart.main(Native Method)
11-23 12:48:51.534: WARN/ActivityManager(59): Force finishing activity com.markerTest/.markerTest
THX
天鹅
答案 0 :(得分:1)