I am handling any uncaught exceptions that occur in my application via:
Thread.setDefaultUncaughtExceptionHandler(this);
were this is my launcher Activity implementing UncaughtExceptionListener. I handle the exception and send it off to my log server just fine, however, my application then doesn't end. It just runs along as a zombie until the home or back button is pressed. How can I kill the process after handling the exception?
Edit
Here is a test and working activity that throws an uncaught exception that is to be caught (by Thread) and handled. The toast is never posted and the process goes zombie once the exception is logged.
class TestActivity extends Activity implements UncaughtExceptionListener {
@Override public void onCreate(Bundle icicle) {
super.onCreate(icicle);
Thread.setDefaultUncaughtExceptionHandler(this);
throw new RuntimeException("I'm a destuctive booger.");
setContentView(R.layout.activity_test);
}
@Override public void uncaughtException(Thread thread, Throwable toss) {
Log.e(TAG, "An uncaught exception has been recieved.", toss);
Toast.makeText(this, "Big Error", Toast.LENGTH_LONG).show();
}
}