title: Exception Handling in Android Studio
body: <p>I have written some simple on button click code. When I run my application and click on the button, it gives the following Error:</p>
  
  <p><strong>Unfortunately, MyApplication has stopped.</strong></p>
  
  <p>Code under the button is following:</p>
  
  <pre><code>public void onClick(View v) {
  
              if (v == mCapture) {
  
                  try {
                      CaptureFingerPrint();
                      RegisterFingerprint();
                  } catch (Throwable e) {
                      mTextViewResult.setText(e.toString());
                  }
  
              }
      }
  </code></pre>
  
  <p>I actually don't want to close my application accidentally and display error in label as i done in exception part of the above code which does not restrict my application to close.</p>
  
  <p>Important to mention that i does not face this error in android studio. I face it when APK installed and run directly on mobile, </p>
  
  <p>Please anyone guide how to restrict my application to close on button click and displaying error in label. The same i done in c# without any issue.</p>