Null Pointer Exception on View Traversal


#1

Hello!

I have an activity with 4 chart fragments (which I have subclassed and setup the axis in the onCreate method (only when savedInstance == null)).

Compiled with Android Kitkat 4.4 and using Shinobi charts trail version 1.5.1

When am swtiching between activities sometimes I get the following stacktrace, is there some known issue?

08-07 10:17:04.357  16182-16182/com.intraix.android.app E/AndroidRuntime﹕ FATAL EXCEPTION: main

    java.lang.NullPointerException

            at com.shinobicontrols.charts.DateTimeAxis.b(SourceFile:489)

            at com.shinobicontrols.charts.DateTimeAxis.a(SourceFile:535)

            at com.shinobicontrols.charts.cu.e(SourceFile:224)

            at com.shinobicontrols.charts.cu.d(SourceFile:161)

            at com.shinobicontrols.charts.cu.a(SourceFile:58)

            at com.shinobicontrols.charts.Axis.a(SourceFile:2386)

            at com.shinobicontrols.charts.x.a(SourceFile:229)

            at com.shinobicontrols.charts.t.onDraw(SourceFile:54)

            at android.view.View.draw(View.java:13924)

            at com.shinobicontrols.charts.t.draw(SourceFile:64)

            at android.view.View.getDisplayList(View.java:12862)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3000)

            at com.shinobicontrols.charts.x.dispatchDraw(SourceFile:110)

            at android.view.View.getDisplayList(View.java:12860)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3000)

            at android.view.View.draw(View.java:13927)

            at android.view.View.getDisplayList(View.java:12862)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3000)

            at android.view.View.getDisplayList(View.java:12860)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3000)

            at android.view.View.draw(View.java:13927)

            at android.widget.FrameLayout.draw(FrameLayout.java:467)

            at android.view.View.getDisplayList(View.java:12862)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3024)

            at android.view.View.getDisplayList(View.java:12860)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3000)

            at android.view.View.draw(View.java:13927)

            at android.widget.FrameLayout.draw(FrameLayout.java:467)

            at android.widget.ScrollView.draw(ScrollView.java:1579)

            at android.view.View.getDisplayList(View.java:12862)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3000)

            at android.view.View.draw(View.java:13927)

            at android.widget.FrameLayout.draw(FrameLayout.java:467)

            at android.view.View.getDisplayList(View.java:12862)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3000)

            at android.view.View.getDisplayList(View.java:12860)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.View.draw(View.java:13640)

            at android.view.ViewGroup.drawChild(ViewGroup.java:3136)

            at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3000)

            at android.view.View.draw(View.java:13927)

            at android.widget.FrameLayout.draw(FrameLayout.java:467)

            at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2331)

            at android.view.View.getDisplayList(View.java:12862)

            at android.view.View.getDisplayList(View.java:12906)

            at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1249)

            at android.view.ViewRootImpl.draw(ViewRootImpl.java:2545)

            at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2405)

            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.


#2

Hello Saiaspire,

Thanks for your input here.

I will look into this for you and come back to you when I have further information.

Thanks,

Kai


#3

Thanks Kai! Appreciate it!


#4

Hello Saiaspire,

Could you please post the activity code where the charts are set up, and ideally also the code where you are switching between activities?

Thanks,

Kai