新增firebase-crashlytics

This commit is contained in:
2022-10-24 17:55:43 +08:00
parent ab6e578336
commit 6b7fd4d53e
4 changed files with 32 additions and 6 deletions

View File

@@ -102,11 +102,11 @@ public class NeverCrashUtils {
Toast.makeText(application, "发生闪退", Toast.LENGTH_SHORT).show();
FileUtil.saveStringToFile(new File(application.getDir("files", Context.MODE_PRIVATE).getAbsolutePath()),throwableToString(e),"error.log");
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
return;
}
}
});
/*
//子线程异常拦截
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
if (isDebugMode()) {
@@ -118,7 +118,7 @@ public class NeverCrashUtils {
getMainCrashHandler().mainException(Looper.getMainLooper().getThread(), e);
getUncaughtCrashHandler().uncaughtException(t, e);
});
});*/
}
public interface MainCrashHandler {