Skip to content

Instantly share code, notes, and snippets.

@yishai-glide
Created July 8, 2015 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yishai-glide/7ed5f4b6bdca3c48d087 to your computer and use it in GitHub Desktop.
Save yishai-glide/7ed5f4b6bdca3c48d087 to your computer and use it in GitHub Desktop.
private static UncaughtExceptionHandler exceptionHandler = new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
ex.printStackTrace();
Runnable onPostExecute = new Runnable() {
@Override
public void run() {
Process.killProcess(Process.myPid());
System.exit(10);
}
};
AppInfo.reportFC(applicationContext, sw.toString(), onPostExecute);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment