title: postDelayed and removeCallbacks not working as expected
body: <p>I am working on a stopwatch app which has a start button. After clicking on the start button, the timer starts and button text is updated to Pause. After clicking on Pause, the timer stops and button text changes to Resume. When I click on resume, I expect the timer to start from where it paused, but the timer jumps to few seconds forward. Below is the code snippet:</p>
  
  <pre><code>    @Override
          protected void onCreate(Bundle savedInstanceState) {
      this.timerHandler = new Handler();
      startButton.setOnClickListener(new View.OnClickListener() {
                  public void onClick(View v) {
                      if(!MainActivity.running &amp;&amp; !MainActivity.paused) {
                          MainActivity.running = true;
                          MainActivity.paused = false;
                          MainActivity.startTime = System.currentTimeMillis();
                          startTimer();
                          startButton.setText("PAUSE");
                      }
                      else if (MainActivity.running &amp;&amp; !MainActivity.paused) {
                          MainActivity.running = false;
                          stopTimer();
                          MainActivity.paused = true;
                          MainActivity.pauseTime = System.currentTimeMillis();
                          MainActivity.pauseTimerText = timerText(); // Eg: 00:00:08
                          startButton.setText("RESUME");
                      }
                      else if(MainActivity.paused) {
                          MainActivity.running = true;
                          MainActivity.paused = false;
                          startTimer();
                          startButton.setText("PAUSE");
                      }
  
                      resetButton.setVisibility(View.VISIBLE);
                  }
              });
      }
  
  
  Runnable timerRunnable = new Runnable() {
          @Override
          public void run() {
              if (!MainActivity.running) {
                  return;
              }
              if (pauseTimerText != null)
              {
                  MainActivity.timerTV.setText(pauseTimerText); // this gets set to 00:00:08 here
                  pauseTimerText = null;
              }
              else
              {
                  MainActivity.timerTV.setText(timerText());
              }
              timerHandler.postDelayed(timerRunnable, 100); // this changes the timer text.
          }
      };
  
      void startTimer() {
          MainActivity.running = true;
          timerRunnable.run();
      }
  
      void stopTimer() {
          MainActivity.running = false;
          timerHandler.removeCallbacks(timerRunnable);
          timerHandler.removeCallbacksAndMessages(null);
      }
  </code></pre>
  
  <p>If my pauseTimerText is 00:00:08, then in runnable "MainActivity.timerTV.setText(pauseTimerText);" line does set the timer text to 00:00:08, but I noticed that after postDelayed gets executed, instead of timer showing 00:00:08 on UI, it would show something like 00:00:13 i.e. it also adds up and shows the time it was paused. </p>
  
  <p>Looks like either postDelayed is not working right or removeCallBacks is not removing everything. </p>