title: Android ProgressBar setProgress() update causes frame drops in Camera Preview
body: <p>I have a layout which consist of a Camera Preview on the top and a progress bar below it.</p>
  
  <p>The progress bar is responsible of updating the progress of a MediaPlayer.
  I'm using a Handler to achieve this, the problem is when I start the media player, the progress bar updates causes some frame drops on the camera preview.</p>
  
  <p>I need to maintain the same frame rate which is ~30 fps initially.</p>
  
  <p>Handler code :</p>
  
  <pre><code>protected Handler mHandler = new Handler() {
      Runnable runnable = new Runnable() {
          @Override
          public void run() {
              // waveprogress is the ProgressBar
              waveProgress.setProgress((mMediaPlayer.getCurrentPosition() * 100) / mMediaPlayer.getDuration());
          }
      };
      @Override
      public void handleMessage(Message msg) {
          switch (msg.what) {
              case SHOW_PROGRESS:
                  waveProgress.post(runnable);
                  sendMessageDelayed(obtainMessage(SHOW_PROGRESS), 350);
                  break;
          }
      }
  };
  </code></pre>