title: How to stop a running thread when Activity on destroy at Android?
body: <p>I used some thread objects in my Android activity.  But these threads do not stop itself  when Activity on destroy. My code for thread-stopping as following:</p>
  
  <pre><code>@Override
  public void onDestroy() {
      super.onDestroy();
      thread.interrupt();
  }
  </code></pre>
  
  <p>Above code is not only working for thread object stopping but also throws an InterruptedException. What's the correct way to stop a running thread without exceptions?</p>
  
  <hr>
  
  <p>is it not an error when thread object throws InterruptedException?</p>