code: private void startTimer(long duration) {
          if (mCountDown != null) {
              mCountDown.cancel();
              mCountDown = null;
          }
  
          // refresh progress every seconds.
          mCountDown = new CountDownTimer(duration, 1000) {
              @Override
              public void onTick(long millisUntilFinished) {
                  Intent i = new Intent(PlaybackListener.ACTION_ON_PROGRESS_CHANGED);
                  i.putExtra(PlaybackListener.EXTRA_KEY_CURRENT_TIME, mMediaPlayer.getCurrentPosition());
                  mLocalBroadcastManager.sendBroadcast(i);
              }
  
              @Override
              public void onFinish() {
                  Intent i = new Intent(PlaybackListener.ACTION_ON_PROGRESS_CHANGED);
                  i.putExtra(PlaybackListener.EXTRA_KEY_CURRENT_TIME
                          , (int) mPlayerPlaylist.getCurrentTrack().getDurationInMilli());
                  mLocalBroadcastManager.sendBroadcast(i);
              }
          };
          mCountDown.start();
      }
docs: Start internal timer used to propagate the playback position.
  
  @param duration duration for which the timer should be started.