Add saving crash log

This commit is contained in:
seven332 committed 2019-02-11 18:14:35 +08:00
1 parent 6d72349ee7
commit c5a6526171
9 files changed
+196

No files matched your search

@@ -104,6 +104,19 @@ public class EhApplication extends RecordingApplication {
public void onCreate() {
instance = this;
Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
try {
if (Settings.getSaveCrashLog()) {
Crash.saveCrashLog(instance, e);
}
} catch (Throwable ignored) { }
if (handler != null) {
handler.uncaughtException(t, e);
}
});
super.onCreate();
GetText.initialize(this);