KelvinAng95 / osmbonuspack

Automatically exported from code.google.com/p/osmbonuspack
0 stars 0 forks source link

OverlayItem's mHotspotPlace could be null if setMarketHotspot is not called in ExtendedItemOverlay before getHotspot #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The following code will throw a NullPointerException when trying to click on 
the map marker.

List<ExtendedOverlayItem> list = new ArrayList<ExtendedOverlayItem>();
        list.add(new ExtendedOverlayItem("title", "description", new GeoPoint(40.275405, -74.058076), getActivity().getApplicationContext()));
        ItemizedOverlayWithBubble<ExtendedOverlayItem> itemizedBubble = 
                  new ItemizedOverlayWithBubble<ExtendedOverlayItem>(getActivity().getApplicationContext(), list, mapView, new LocationInfoWindow(mapView));
        mapView.getOverlayManager().add(itemizedBubble);

OverlayItem's mHotspotPlace could be null if setMarketHotspot is not called in 
ExtendedItemOverlay before getHotspot

What version of the product are you using?
osmbonuspack_v1.5.jar

Please provide any additional information below.
07-11 18:41:52.757: E/ACRA(23869): ACRA caught a NullPointerException exception 
for mil.vrod. Building report.
07-11 18:41:53.539: E/AndroidRuntime(23869): FATAL EXCEPTION: main
07-11 18:41:53.539: E/AndroidRuntime(23869): java.lang.NullPointerException
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.bonuspack.overlays.ExtendedOverlayItem.getHotspot(ExtendedOverlayIt
em.java:86)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.bonuspack.overlays.ExtendedOverlayItem.showBubble(ExtendedOverlayIt
em.java:135)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.bonuspack.overlays.ItemizedOverlayWithBubble.showBubbleOnItem(Itemi
zedOverlayWithBubble.java:76)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.bonuspack.overlays.ItemizedOverlayWithBubble.onSingleTapUpHelper(It
emizedOverlayWithBubble.java:82)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.views.overlay.ItemizedIconOverlay$1.run(ItemizedIconOverlay.java:12
4)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.views.overlay.ItemizedIconOverlay.activateSelectedItems(ItemizedIco
nOverlay.java:178)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.views.overlay.ItemizedIconOverlay.onSingleTapUp(ItemizedIconOverlay
.java:117)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.views.overlay.OverlayManager.onSingleTapUp(OverlayManager.java:272)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.views.MapView$MapViewGestureDetectorListener.onSingleTapUp(MapView.
java:1312)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.GestureDetector.onTouchEvent(GestureDetector.java:568)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
org.osmdroid.views.MapView.dispatchTouchEvent(MapView.java:782)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(P
honeWindow.java:2060)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow
.java:1398)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.app.Activity.dispatchTouchEvent(Activity.java:2364)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneW
indow.java:2008)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.View.dispatchPointerEvent(View.java:5768)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2911)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2485)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:852)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2494)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.os.Handler.dispatchMessage(Handler.java:99)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.os.Looper.loop(Looper.java:137)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
android.app.ActivityThread.main(ActivityThread.java:4514)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
java.lang.reflect.Method.invokeNative(Native Method)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
java.lang.reflect.Method.invoke(Method.java:511)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
07-11 18:41:53.539: E/AndroidRuntime(23869):    at 
dalvik.system.NativeStart.main(Native Method)

Original issue reported on code.google.com by christop...@gmail.com on 11 Jul 2012 at 6:45

GoogleCodeExporter commented 8 years ago
I meant to say it could be null if OverlyaItem's getMarkerHotspot() is called 
before setting the hotspot

Original comment by christop...@gmail.com on 11 Jul 2012 at 6:54

GoogleCodeExporter commented 8 years ago
I'm using osmdroid-android-3.0.8.jar

Original comment by christop...@gmail.com on 11 Jul 2012 at 7:03

GoogleCodeExporter commented 8 years ago
Effectively. Fixed in the trunk now. Jar file not updated yet. 

Original comment by mathieu....@gmail.com on 12 Jul 2012 at 8:51

GoogleCodeExporter commented 8 years ago
:)

Original comment by christop...@gmail.com on 12 Jul 2012 at 9:01

GoogleCodeExporter commented 8 years ago
Fixed in jar 1.5.1. 

Original comment by mathieu....@gmail.com on 13 Jul 2012 at 11:12