title: Android Runnable runs faster after Resume
body: <h1>Scenario</h1>
  
  <p>I have a runnable that outputs a the value of a variable every 1 second. The runnable starts when I start the mainActivity and runs throughout the app in the background.</p>
  
  <h1>Problem</h1>
  
  <p>When I close the app (hidden state) and start the app again, the logcat starts outputting faster. It goes faster everytime I do this. Why ?</p>
  
  <pre><code>@Override
  public void onStart()
  {
      mHandler.postDelayed(myRunnable, 1000);
      super.onStart();
  }
  
   public Runnable myRunnable = new Runnable()
   {
      @Override
      public void run()
      { 
         count ++;
         android.util.Log.w("     SYNC     ", "COUNT:"+count);
         mHandler.postDelayed(myRunnable, 1000);
      }
  };
  </code></pre>
  
  <h1>SOLUTION / EDIT</h1>
  
  <p>Thank you all for answering ! I will give credit. However, it was @pskink who posted this <a href="https://stackoverflow.com/questions/21131878/android-runnable-runs-faster-after-resume#comment31800567_21131878">Android Runnable runs faster after Resume</a> , that solved it for me.</p>