private final Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread thread, Throwable ex) {
Log.e("TestApplication", "Uncaught exception is: ", ex);
}
};
onCreate 中调用 Thread.setDefaultUncaughtExceptionHandler(handler);