-1

在 android 应用程序中,我使用 Google API 进行地图。我得到了以下异常。我想知道这个异常到底是什么意思?

10-19 23:45:06.619: E/AndroidRuntime(837): FATAL EXCEPTION: main
10-19 23:45:06.619: E/AndroidRuntime(837): java.lang.NullPointerException
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.google.android.maps.ItemizedOverlay.getItemsAtLocation(ItemizedOverlay.java:617)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.google.android.maps.ItemizedOverlay.getItemAtLocation(ItemizedOverlay.java:586)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.google.android.maps.ItemizedOverlay.handleMotionEvent(ItemizedOverlay.java:498)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.google.android.maps.ItemizedOverlay.onTouchEvent(ItemizedOverlay.java:572)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.google.android.maps.OverlayBundle.onTouchEvent(OverlayBundle.java:63)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.google.android.maps.MapView.onTouchEvent(MapView.java:679)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.view.View.dispatchTouchEvent(View.java:3885)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1691)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1125)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1675)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2194)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1878)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.os.Looper.loop(Looper.java:130)
10-19 23:45:06.619: E/AndroidRuntime(837):  at android.app.ActivityThread.main(ActivityThread.java:3683)
10-19 23:45:06.619: E/AndroidRuntime(837):  at java.lang.reflect.Method.invokeNative(Native Method)
10-19 23:45:06.619: E/AndroidRuntime(837):  at java.lang.reflect.Method.invoke(Method.java:507)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-19 23:45:06.619: E/AndroidRuntime(837):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-19 23:45:06.619: E/AndroidRuntime(837):  at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

1

就像您忘记populate()在构造函数中添加的声音一样。

它应该是这样的:

LocationItemizedOverlay(Drawable defaultMarker, Context context) {
    super(boundCenterBottom(defaultMarker));
    this.context = context;
    populate(); // Add this
}
.....

它发生在移动地图上

于 2012-10-20T00:13:43.260 回答