title: Disable Button for a short time to avoid double click
body: <p>i am using following code to take a picture</p>
  
  <pre><code> captureBtn.setOnClickListener(new View.OnClickListener() 
          {
              @Override
              public void onClick(View v) 
              {
  
                  mCamera.takePicture(null, null, mPicture);
              }
          });
  </code></pre>
  
  <p>The problem is sometimes if user just presses the button twice instantly, it crashes with following error </p>
  
  <p>j</p>
  
  <pre><code>ava.lang.RuntimeException: takePicture failed
  at android.hardware.Camera.native_takePicture(Native Method)
  at android.hardware.Camera.takePicture(Camera.java:1202)
  at android.hardware.Camera.takePicture(Camera.java:1147)
  at com.diadori.thevow.CameraActivity$4.onClick(CameraActivity.
  </code></pre>
  
  <p>How can i prevent user from double clicking instantly on a Button in android?</p>