title: Android Handler for repeated task - will it overlap ? Timer-task VS handler VS alarm-manager
body: <p>I'm trying to build an Android app which will repeatedly run some process every 10 mins.
  As I found out <code>Handlers</code> are more reliable than timers or scheduling. So I'm going to develop my app using the <code>Handlers</code> using the given below codes.</p>
  
  <p>I'm little bit concerned that the below codes will create separate <code>Handlers</code> at each time I start the app and keep them running parallel, may be since I'm creating the <code>Handler</code> on <code>onCreate</code>.</p>
  
  <p>So what is the best way to keep only a single <code>Handler</code> runs in background at a time? </p>
  
  <pre><code>private Handler handler;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      handler = new Handler(); // new handler
      handler.postDelayed(runnable, 1000*60*10); // 10 mins int.
      setContentView(R.layout.activity_pro__sms);
  } 
  
  private Runnable runnable = new Runnable() {
      @Override
      public void run() {
          /* my set of codes for repeated work */
          foobar();
          handler.postDelayed(this, 1000*60*10); // reschedule the handler
      }
  };
  </code></pre>