In a custom component that displays a small-scale tiled map (similar
to iOS CATiledLayer), I'm rendering tiles on-demand based on the scale
level the user has supplied (via pinch events or zoom controls).

I'm using an AsyncTask to load up the bitmaps and rendering them with
publishProgress.  This generally works fine, but if a user initiates a
pinch event (and triggers a scale action) while an tile set (that's no
longer valid because a new one qualifies) is transitioning out, I get
a force-close.  Logcat mentions a NullPointerException in a call to
dispatchDraw, but I can't find out where the issue is happening
specifically.

I know that there's no enough info here to determine the specific
issue or a fix, and the code is too long to be appropriate in a list
discussion, but any insight as to where I could find the source of the
error specifically would be great.

I've tried try/catches all over the place, and sending the exception
to the output with a note as to the source, but haven't yet caught
anything.

I'll paste a copy of the log:

02-28 21:03:40.385: W/dalvikvm(3978): threadid=1: thread exiting with
uncaught exception (group=0x4001e578)
02-28 21:03:40.385: E/AndroidRuntime(3978): FATAL EXCEPTION: main
02-28 21:03:40.385: E/AndroidRuntime(3978):
java.lang.NullPointerException
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1372)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.drawChild(ViewGroup.java:1644)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.View.draw(View.java:7022)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.widget.FrameLayout.draw(FrameLayout.java:357)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.drawChild(ViewGroup.java:1646)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.drawChild(ViewGroup.java:1644)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.View.draw(View.java:7022)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.widget.FrameLayout.draw(FrameLayout.java:357)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.drawChild(ViewGroup.java:1646)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.drawChild(ViewGroup.java:1644)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.View.draw(View.java:7022)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.widget.FrameLayout.draw(FrameLayout.java:357)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
com.android.internal.policy.impl.PhoneWindow
$DecorView.draw(PhoneWindow.java:1917)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewRoot.draw(ViewRoot.java:1562)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewRoot.performTraversals(ViewRoot.java:1298)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1900)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.os.Handler.dispatchMessage(Handler.java:99)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.os.Looper.loop(Looper.java:130)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
android.app.ActivityThread.main(ActivityThread.java:3691)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
java.lang.reflect.Method.invokeNative(Native Method)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
java.lang.reflect.Method.invoke(Method.java:507)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:907)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
02-28 21:03:40.385: E/AndroidRuntime(3978):     at
dalvik.system.NativeStart.main(Native Method)

TYIA

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to