Issue #35 resolved

java.lang.NullPointerException at PieGraph.onTouchEvent(PieGraph.java:138)

abhinav khanger
created an issue

Hi I can't reproduce the bug.

java.lang.NullPointerException at android.graphics.Region.setPath(Region.java:105) at com.echo.holographlibrary.PieGraph.onTouchEvent(PieGraph.java:138) at android.view.View.dispatchTouchEvent(View.java:7149) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2184) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1883) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1959) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1399) at android.app.Activity.dispatchTouchEvent(Activity.java:2428) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1907) at android.view.View.dispatchPointerEvent(View.java:7329) at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3280) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3219) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4265) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4244) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4341) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:125) at android.os.Looper.loop(Looper.java:124) at android.app.ActivityThread.main(ActivityThread.java:5059) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) at dalvik.system.NativeStart.main(NativeStart.java)

Comments (4)

  1. Scott Baar

    I assume it's this line?

    r.setPath(slice.getPath(), slice.getRegion());
    

    This happened to me in piegraph and bargraph when i rapidly clicked on a loading page. I'm not quite sure why it happens but maybe it's because you can do something like call setthickness which invalidates and calls on draw before setslices can necessarily be called and the regions set. In any case adding a

    if (r != null) solved it without negative consequence.

  2. Log in to comment