title: How to Stop Handler thread?
body: <p>I want to stop this thread on button click.</p>
  
  <pre><code>TIME_OUT = 45000;
  new Handler().postDelayed(new Runnable() {
         @Override
         public void run() {
           Intent i = new 
           Intent(MapsActivity.this,MapsActivity.class);
           startActivity(i);
           finish();
         }
       }, TIME_OUT);
  </code></pre>
  
  <p>I am using above handler in <code>onCreate</code> of an Activity. I want to stop it. How to stop this thread on click of any button or on click of on Back Pressed?</p>