title: how to close an android application after exception caught
body: <p>I am designing an Android Application where i want to check details if crash happens. So i used Thread.UncaughtExceptionHandler() Class. It generate detail of Crashed Thread but Application Stuck once crash occur. I want to close my application immediately after crash but also want to detail of Thread. I include following code in the Activity class. Any suggestion?</p>
  
  <pre><code>Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
  
              @Override
              public void uncaughtException(Thread thread, Throwable ex) {
                  Log.e("UserApp", "uncaught_exception_handler: uncaught exception in thread " + thread.getName(), ex);
  
  
                  if(ex instanceof RuntimeException)
                      throw (RuntimeException)ex;
                  if(ex instanceof Error)
                      throw (Error)ex;
  
  
                  Log.e("UserApp", "uncaught_exception handler: unable to rethrow checked exception");
  
              }
  </code></pre>