tags:

views:

207

answers:

1

I am having an issue with my app, soley on the Moto DEXT. I have tried to reproduce on my Hero and the 1.5 emulator with no luck.

The exception (see logcat snippet below) seems to be coming from within the system code, so I may be out of luck.

Rough jist is, user presses the button, new MapActivity loads, they see the grid start then get a force close. On loading the MapActivity loads up a customised MyLocationOverly (very little changed, mostly a kludge to allow a map click to be caught).

Has anyone else experienced anything similar, and can point out if I am going wrong.

02-12 18:21:18.587 I/ActivityManager(   83): Displayed activity uk.me.cpearson.runningLate/.LocationMap: 1589 ms
02-12 18:21:19.807 I/Maps.MyLocationOverlay( 2094): Running deferred on first fix: uk.me.cpearson.runningLate.LocationMap@4338bfe8
02-12 18:21:19.907 W/dalvikvm( 2094): threadid=3: thread exiting with uncaught exception (group=0x4000ff28)
02-12 18:21:19.907 E/AndroidRuntime( 2094): Uncaught handler: thread main exiting due to uncaught exception
02-12 18:21:19.957 E/AndroidRuntime( 2094): java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable
02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.MyLocationOverlay.getLocationDot(MyLocationOverlay.java:180)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.MyLocationOverlay.drawMyLocation(MyLocationOverlay.java:561)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.MyLocationOverlay.draw(MyLocationOverlay.java:511)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:45)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.google.android.maps.MapView.onDraw(MapView.java:471)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.View.draw(View.java:5838)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.drawChild(ViewGroup.java:1486)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.View.draw(View.java:5841)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.widget.FrameLayout.draw(FrameLayout.java:352)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.drawChild(ViewGroup.java:1486)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.drawChild(ViewGroup.java:1484)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.View.draw(View.java:5841)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.widget.FrameLayout.draw(FrameLayout.java:352)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1904)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewRoot.draw(ViewRoot.java:1239)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewRoot.performTraversals(ViewRoot.java:1049)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.view.ViewRoot.handleMessage(ViewRoot.java:1518)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.os.Handler.dispatchMessage(Handler.java:99)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.os.Looper.loop(Looper.java:123)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at android.app.ActivityThread.main(ActivityThread.java:3977)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at java.lang.reflect.Method.invokeNative(Native Method)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at java.lang.reflect.Method.invoke(Method.java:521)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
02-12 18:21:19.957 E/AndroidRuntime( 2094): at dalvik.system.NativeStart.main(Native Method)
02-12 18:21:22.927 I/ActivityManager(   83): Process uk.me.cpearson.runningLate (pid 2094) has died.
02-12 18:21:22.937 I/WindowManager(   83): WIN DEATH: Window{43687060 Toast paused=false}
02-12 18:21:22.947 I/WindowManager(   83): WIN DEATH: Window{43677f00 uk.me.cpearson.runningLate/uk.me.cpearson.runningLate.Home paused=false}
02-12 18:21:22.947 I/WindowManager(   83): WIN DEATH: Window{43682890 uk.me.cpearson.runningLate/uk.me.cpearson.runningLate.LocationMap paused=false}
02-12 18:21:23.007 I/ActivityManager(   83): Start proc uk.me.cpearson.runningLate for activity uk.me.cpearson.runningLate/.Home: pid=2105 uid=10063 gids={3003}
A: 

This is a known issue on Motorola DEXT/CLIQ phones.

Answer can be found here: http://community.developer.motorola.com/t5/Android-App-Development-for/Google-Maps/m-p/3421/highlight/true#M396

You have to overload the default draw, catching the exception and then drawing your own icon.

themaninthesuitcase