title: Disable button after a click for 2 seconds and resume back
body: <p>When I click a resend button first time, the button will disable for 2 seconds.After 2 seconds the button will enable?
  I am using this code</p>
  
  <pre><code>    btn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              btn.setEnabled(false);
              btn.postDelayed(new Runnable() {
                  public void run() {
                      btn.setEnabled(true);
                      Log.d(TAG,"resend1");
                  }
              },1000);
          }
      });
  </code></pre>
  
  <p>But this code is not working properly.</p>