stopping android handler loop
<p>i am using a class which extends Handler class to update my activity UI.
The code is as follows in side main activity,</p>

<pre><code>public class RefreshHandler extends Handler {

     public void handleMessage(Message msg) {


      Homeform.this.updateUI();
     }
     public void sleep(long delayMillis) {
      this.removeMessages(0);
         sendMessageDelayed(obtainMessage(0), delayMillis);
     }
 };

 private void updateUI(){
  Log.v(""," I am inside Update UUI=====================");

  refresh();
     mRedrawHandler.sleep(5000);

 }
</code></pre>

<p>And i had call this method handleMessage() on the object of RefreshHandler as follows</p>

<pre><code>mRedrawHandler = new RefreshHandler();

mRedrawHandler.handleMessage(new Message());
</code></pre>

<p>But here i am facing one problem that it is running after closing my application also .</p>

<p>please solve my problem to stop this handler when close this application.</p>

<p>Thank you..</p>
