google map android v2 MarkerOption icon cannot accept StateListDrawable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

google map android v2 MarkerOption icon cannot accept StateListDrawable

Kiwi de coder
hi,

I wanna add a StateListDrawable as a marker icon, however, it give me an nullpointer exception, any workaround ?

12-06 18:52:51.152: E/AndroidRuntime(3264): Caused by: java.lang.NullPointerException
12-06 18:52:51.152: E/AndroidRuntime(3264):     at maps.y.bw.a(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at maps.y.bw.b(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at maps.y.bw.a(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at maps.y.ae.addMarker(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at com.google.android.gms.maps.internal.IGoogleMapDelegate$Stub.onTransact(IGoogleMapDelegate.java:167)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at android.os.Binder.transact(Binder.java:279)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at com.google.android.gms.maps.internal.IGoogleMapDelegate$a$a.addMarker(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at com.google.android.gms.maps.GoogleMap.addMarker(Unknown Source)


thx,
kiwi

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/cTTYQavxT68J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: google map android v2 MarkerOption icon cannot accept StateListDrawable

Kiwi de coder
my code here:

MarkerOptions marker = new MarkerOptions().position(x).title("Marker").icon(BitmapDescriptorFactory.fromResource(R.drawable.state));



On Thursday, 6 December 2012 18:49:45 UTC+8, Kiwi de coder wrote:
hi,

I wanna add a StateListDrawable as a marker icon, however, it give me an nullpointer exception, any workaround ?

12-06 18:52:51.152: E/AndroidRuntime(3264): Caused by: java.lang.NullPointerException
12-06 18:52:51.152: E/AndroidRuntime(3264):     at maps.y.bw.a(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at maps.y.bw.b(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at maps.y.bw.a(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at maps.y.ae.addMarker(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at com.google.android.gms.maps.internal.IGoogleMapDelegate$Stub.onTransact(IGoogleMapDelegate.java:167)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at android.os.Binder.transact(Binder.java:279)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at com.google.android.gms.maps.internal.IGoogleMapDelegate$a$a.addMarker(Unknown Source)
12-06 18:52:51.152: E/AndroidRuntime(3264):     at com.google.android.gms.maps.GoogleMap.addMarker(Unknown Source)


thx,
kiwi

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/y4Z5U3RutCYJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.