0
我有一個應用程序即將完成。 手機在線時,一切正常。Android谷歌地圖崩潰時離線
由於應用即將發佈,因此我在手機處於脫機狀態時進行了測試。 這使它崩潰。
經過一些調試後,我發現如果我不添加任何覆蓋它不會崩潰。 (我只是得到了網格,並且我能理解; D)
一旦覆蓋層試圖繪製某些東西就會崩潰。 這甚至包括提供的覆蓋「MyLocationOverlay」,一旦GPS得到修復,就會崩潰(並因此嘗試繪製用戶位置)。
有什麼我失蹤?
編輯 通過大衆的需求;) 堆棧跟蹤
我相信,我不加空物體進入覆蓋,這是我查
02-27 15:12:53.254: WARN/dalvikvm(5376): threadid=1: thread exiting with uncaught exception (group=0x400259f8)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): FATAL EXCEPTION: main
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): java.lang.NullPointerException
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.google.android.maps.ItemizedOverlay.getItemsAtLocation(ItemizedOverlay.java:617)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.google.android.maps.ItemizedOverlay.getItemAtLocation(ItemizedOverlay.java:586)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.google.android.maps.ItemizedOverlay.handleMotionEvent(ItemizedOverlay.java:498)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.google.android.maps.ItemizedOverlay.onTouchEvent(ItemizedOverlay.java:572)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.google.android.maps.OverlayBundle.onTouchEvent(OverlayBundle.java:63)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.google.android.maps.MapView.onTouchEvent(MapView.java:643)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.view.View.dispatchTouchEvent(View.java:3765)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:905)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:871)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:871)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:871)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:871)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1701)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.app.Activity.dispatchTouchEvent(Activity.java:2093)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1685)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.view.ViewRoot.handleMessage(ViewRoot.java:1802)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.os.Handler.dispatchMessage(Handler.java:99)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.os.Looper.loop(Looper.java:144)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at android.app.ActivityThread.main(ActivityThread.java:4937)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at java.lang.reflect.Method.invokeNative(Native Method)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at java.lang.reflect.Method.invoke(Method.java:521)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-27 15:12:53.264: ERROR/AndroidRuntime(5376): at dalvik.system.NativeStart.main(Native Method)
在Eclipse中使用'adb logcat',DDMS或DDMS透視圖檢查LogCat並查看與崩潰相關的堆棧跟蹤。 – CommonsWare 2011-02-27 14:03:14
是從網絡上取得的這些重疊圖標還是其他東西? – Reno 2011-02-27 22:05:33
@Reno nope,它們是隨應用程序 – Victor 2011-02-28 10:12:47