title: android: how to quit the app properly on error
body: <p>I added an exceptionhandler for unhandled exceptions, to know that the app has crashed on the next app start:</p>
  
  <pre><code>@Override
  public void uncaughtException(Thread thread, Throwable ex) {
      SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
      SharedPreferences.Editor editor = preferences.edit();
      editor.putString("crashed", "yes");
      editor.commit();
  }
  </code></pre>
  
  <p>I added the handler via:</p>
  
  <pre><code>Thread.setDefaultUncaughtExceptionHandler(this);
  </code></pre>
  
  <p>Now the thing is: since I added the handler, the app behaves differently on error:</p>
  
  <ul>
  <li><p>Before I added the handler I got a popup telling me that the app has crashed.</p></li>
  <li><p>Now, after adding the handler the app just freezes, and after a while android shows me a popup telling me that the app does not respond anymore and whether I want to wait any longer. This is not good IMO. Any hints, how to properly exit after an application crash?</p></li>
  </ul>