Pre loader

problem with xiaomi phones when resume chart after pause it

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


I have a chart from a sound.
In xiaomi phones when resume chart after pause it, my line chart faces the severe lag.
In other phones my chart work well.
what should I do?
phone is (Xiaomi mi a3)

private void resume() {

    forceRunInPauseMode = true;
    completedState = false;
    pauseState = false;

private void updateChart() {
    schedule = scheduledExecutorService.scheduleWithFixedDelay(() -> {
        if (mediaPlayer.isPlaying() || forceRunInPauseMode){
            UpdateSuspender.using(binding.sciChart, mRunnable);


private Runnable mRunnable = new Runnable() {
    public void run() {
        forceRunInPauseMode = false;

        currentTime = mediaPlayer.getCurrentPosition();
        currentRange = currentTime * 2;

        if (currentRange < 0)
            currentRange = 0;
        else if (currentRange > xDoubleArray.length - 1)
            currentRange = xDoubleArray.length - 1;

        if (!drawed) {
            DoubleValues xValues = new DoubleValues(Arrays.copyOfRange(xDoubleArray, 0, xDoubleArray.length-1));
            DoubleValues yValues = new DoubleValues(Arrays.copyOfRange(yDoubleArray, 0, yDoubleArray.length-1));
            DoubleSeries doubleSeries = new DoubleSeries(xValues, yValues);
            lineData.append(doubleSeries.getxValues(), doubleSeries.getyValues());
            drawed = true;
        xVisibleRange.setMinMax((double) (currentRange - visibleInterval / 2), (double) (currentRange + visibleInterval / 2));
  • Yura Khariton
    Hi there. Are you sure that it’s SciChart related issue? Maybe it could be caused by using MediaPlayer or using ScheduledExecutorService? Did you try to profile application to find out what causes the lag?
  • abolfazl ghanbari
    I didn’t see such an issue in the issues. and also profiled this app. ScheduledExecutorService is ok.
  • Yura Khariton
    I meant are you sure that this issue is caused by using SciChart code? Did you try to comment SciChart code in your application or maybe profiling showed something, that confirmed that lag occurs in SciChart code? Also did you check logcat messages? Maybe there are some errors or other messages, which could help to determine the cause of the issue. I’m asking, because these types of issue ( that occur on some specific device ) are very tricky and hard to fix. Maybe you can provide a full project which reproduces this issue?
  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.