title: Stop and restart a already running thread
body: <p>The Thread should end if I press a button, which sets the isButtonPressed to true.
  My problem is, that if a want to start the thread with thread.start(runnable) by clicking the button, I get this: <em>IllegalThreadStateException: Thread already</em> started (I thought the thread was terminated after the break because the the loop is over, but it seems that I am wrong).</p>
  
  <pre><code>Thread thread = new Thread(runnable);
  thread.start(runnable);
  </code></pre>
  
  <p>The runnable Runnable:</p>
  
  <pre><code>    Runnable runnable = new Runnable() {
      @Override
      public void run() {
          time = 10;
          for (int i = 10; i &lt;= 10; i--) {
              handler.post(new Runnable() {
                  @Override
                  public void run() {
                      txt_Time.setText(String.valueOf(time));
                  }
              });
  
              try {
                  Thread.sleep(1000);
              } catch (InterruptedException e) {
              }
  
              if (isButtonPressed) {
                  break;
              }
  
              if (time == 0) {
                  resetVisibleState();
                  break;
              } else {
                  time--;
              }
          }
      }
  };
  </code></pre>
  
  <p>Thanks for your help!</p>