title: onClick() setting incrementation and delay
body: <p>I'm new to Android and I'm working on a tiny project with a set of strict parameters. One of them is to have a multifunction button that increments a timer every time it's clicked, and that starts only after I didn't increment said timer for 3 seconds.</p>
  
  <p>I found three or four ways on how to set an alarm of sorts with <code>Handler</code>, <code>CountDownTimer</code>, <code>Timer</code>, or some other way, but I'm confused on how I can do what I'm looking for with just the <code>onClick()</code> method.</p>
  
  <p>The function to wait for 3s(), I'm calling it after:</p>
  
  <pre><code>public void wait3s()
  {
      Thread thread = new Thread() {
          @Override
          public void run()
          {
              while (!isInterrupted()) {
  
                  try {
                      Thread.sleep(3000);
                      runOnUiThread(new Runnable() {
                          @Override
                          public void run() {
                              count++;
                              threeS.setText(String.valueOf(count));
                          }
                      });
  
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }
          }
      };
      thread.start();
  }
  </code></pre>
  
  <p>My <code>onClick()</code> just calls these:</p>
  
  <pre><code>public void onClick(View view)
  {
        increment();
        wait3s();
        startStop();
  }
  </code></pre>
  
  <p>As you can see, part of the issue is that I'm calling the <code>wait3s()</code> there at every click, and I need a way to control that Thread/Timer (whatever) without it creating a new one at every click. I'm being a little dumb now, but I have been on this for a while and I'm still coming out empty, since I never worked with this before.</p>
  
  <p>Another option for the <code>wait3s()</code> function that I found would be like <a href="https://stackoverflow.com/questions/15874117/how-to-set-delay-in-android?answertab=votes#tab-top">in this other StackOverflow thread</a>. </p>
  
  <p>Thank you</p>
  
  <p>PS: Sorry for the title, I couldn't find a better way to describe it, if you have it, and have the power to change it, please do.</p>