Log an uncaught exception before it crashes the app.

This commit is contained in:
Johannes Mockenhaupt 2019-08-22 11:12:15 +02:00
parent e0421b509c
commit fb6bcfdccd
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -139,6 +139,8 @@ public class MainApp extends Application {
sConstraintsChecker = new ConstraintChecker(); sConstraintsChecker = new ConstraintChecker();
sDatabaseHelper = OpenHelperManager.getHelper(sInstance, DatabaseHelper.class); sDatabaseHelper = OpenHelperManager.getHelper(sInstance, DatabaseHelper.class);
Thread.setDefaultUncaughtExceptionHandler((thread, ex) -> log.error("Uncaught exception crashing app", ex));
try { try {
if (FabricPrivacy.fabricEnabled()) { if (FabricPrivacy.fabricEnabled()) {
Fabric.with(this, new Crashlytics()); Fabric.with(this, new Crashlytics());