title: How to stop a thread?
body: <p>When a thread is alive, how can I stop the thread? I have given like</p>
  
  <pre><code>if(thread.isAlive()){
      thread.stop();
  }
  </code></pre>
  
  <p>but the method stop is deprecated and is throwing an exception</p>
  
  <pre><code>01-21 14:12:40.188: ERROR/global(535):     Deprecated Thread methods are not supported.
  01-21 14:12:40.188: ERROR/global(535):    java.lang.UnsupportedOperationException
  01-21 14:12:40.188: ERROR/global(535):     at java.lang.VMThread.stop(VMThread.java:85)
  01-21 14:12:40.188: ERROR/global(535):     at java.lang.Thread.stop(Thread.java:1379)
  01-21 14:12:40.188: ERROR/global(535):     at java.lang.Thread.stop(Thread.java:1344)
  </code></pre>
  
  <p>How can we solve this?</p>