Pre loader

OpenGL Context seems to be destroyed sometimes after pause or sleep

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

Answered
1
0

Hey folks,

I have an Android device (CAT S40) running 5.1 on it. I am encountering an issue when pressing the home button or lock button. It seems that sometimes when the app is in pause or sleep my chart surfaces are destroyed and turn black. I have only seen this problem on this device. The only way to restore them is to restart the app. I researched this issue an found information on OpenGL context getting destroyed on pause. There is a setting in GLSurfaceView called setPreserveEGLContextOnPause. I am not sure if it is possible to access this setting from the SciChartSurface or not.

After seeing this, I tested the SciChart example app to see if the problem was isolated to my app, but it happened in the example app as well.
Again this is the only device I have seen this happen on and I’ve tested multiple devices.

Thanks for your help

Version
5.1
  • You must to post comments
Best Answer
1
0

Hi Andrew,

You can set preserveEGLContextOnPause flag by creating new instance of RenderSurfaceGL ( our default render surface implementation which is based on GlSurfaceView ) and then assign it to chart. Here is the code sample:

    final RenderSurfaceGL renderSurface = new RenderSurfaceGL(getContext());
    renderSurface.setPreserveEGLContextOnPause(true);

    surface.setRenderSurface(renderSurface);

Please can you try it and tell if this fixes the problem for you?

Best regards,
Yura

  • 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