Pre loader

Frequent Error when Fragment is detached and a new one attached...

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

NativeScript tends to replace fragments rather than destroy the entire activity; so everything lives in a single activity. Unfortunately; when navigating pages the fragment might not be fully detached while the other one is being added (for animation purposes) and it throws this error:

Stacktrace
System.err: Attempt to invoke virtual method ‘void com.scichart.drawing.opengl.ao.a(int, int)’ on a null object reference
System.err:
System.err: StackTrace:
System.err: java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.scichart.drawing.opengl.ao.a(int, int)’ on a null object reference
System.err: at com.scichart.drawing.opengl.aa.doFrame(SourceFile:88)
System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:723)
System.err: at android.view.Choreographer.doFrame(Choreographer.java:655)
System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
System.err: at android.os.Handler.handleCallback(Handler.java:790)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:164)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6494)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

I have tried using suspendUpdates on the surface to stop any updates; and finally went to where I have to manually remove it from the viewport before destruction occurs.

Is their any way to potentially catch this error and ignore it. It only happens during a destruction sequence that the SciChart doesn’t like. Or is their some way to stop all drawing so that it isn’t trying to call whatever is in SourceFile line 88

Also is their a better place to report stack traces for crashes?

Version
3(Latest from myget.org)
  • You must to post comments
0
0

Hi Nathanael,

Can you try to switch to RenderSurface which uses Canvas API for rendering chart? I believe this error can be caused by the fact that we use separate thread for rendering with OpenGL and it looks like that this thread isn’t stopped and tries to draw chart after you try to detach fragment with chart.

Hope this will help you!

Best regards,
Yura

  • Nathanael Anderson
    I’ll test that, thanks for the idea — is their any calls I can make that can suspend/shut the background thread down if I prefer to use OpenGL because of the speed?
  • Yura Khariton
    If you switch to RenderSufaceGL which is based on GlSurfaceView you can use methods provided by Android SDK such as onResume()/onPause() which resume/pause GLThread. But these calls are asynchronous so suspend/resume will take some time. As for GLTextureView ( the default implementation in v3 ) – there is no way to manipulate GLThread for this type of RenderSurface.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies