title: How to update SeekBar from MediaPlayer running in Service?
body: <p>In my app i maid a MediaPlayer playing from Service, to update SeekBar
  i maid a timer task in Service</p>
  
  <pre><code>timer = new Timer();
  timer.scheduleAtFixedRate(new RemindTask(), 0, 1 * 1000);
  
  class RemindTask extends TimerTask {
      @Override
      public void run() {
          if (mediaPlayer!=null &amp;&amp; mediaPlayer.isPlaying()){
             MusicPlayerActivity.progress=mediaPlayer.getCurrentPosition();
             MusicPlayerActivity.total=mediaPlayer.getDuration();
          }
      }
  }
  </code></pre>
  
  <p>and using runnable list i made a run method in activity page,</p>
  
  <pre><code>@Override
  public void run()
  {
      runOnUiThread(new Runnable() {
          @Override
          public void run() {
              seekBar.setMax(total);
              seekBar.setProgress(progress);
          }
      });
  }
  </code></pre>
  
  <p>But my issue is that app is very much slow and going stuck.</p>