Skip to content

Instantly share code, notes, and snippets.

@wakim
Created June 7, 2014 13:53
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 wakim/cd40306adf32c53115af to your computer and use it in GitHub Desktop.
Save wakim/cd40306adf32c53115af to your computer and use it in GitHub Desktop.
public class Application extends android.app.Application implements UncaughtExceptionHandler {
private UncaughtExceptionHandler mDefaultExceptionHandler;
static Application sApp;
@Override
public void onCreate() {
mDefaultExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(this);
}
@Override
public void uncaughtException(Thread thread, Throwable ex) {
mDefaultExceptionHandler.uncaughtException(thread, ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment