In my application, i want to set the uncaught exception handler so that i can do stuff in the event that of an unforseen crash. (i want to do stuff like close out sockets, clear notification...etc.)
Thread.currentThread().setDefaultUncaughtExceptionHandler(sDefaultThreadHandler);
where
private static UncaughtExceptionHandler sDefaultThreadHandler = new UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
// i want ACRA to log here, then clear notifications, close out connections, cancel asynctasks...etc.
// DO NOT REMOVE or else your app will hang when there is a crash.
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(10);
}
};
the problem is, i want ACRA to also report before the process exits. how do i accomplish this?