Log an uncaught exception before it crashes the app.

According to https://fabric.io/kits/android/crashlytics/features (Step 3, 2nd paragraph), registering an UncaughtExceptionHandler before Fabric is set up does not interfere with Fabric.
This commit is contained in:
Johannes Mockenhaupt 2019-08-22 11:12:15 +02:00
parent 2f3a2116fb
commit 91bd2c5b4f
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();
sDatabaseHelper = OpenHelperManager.getHelper(sInstance, DatabaseHelper.class);
Thread.setDefaultUncaughtExceptionHandler((thread, ex) -> log.error("Uncaught exception crashing app", ex));
try {
if (FabricPrivacy.fabricEnabled()) {
Fabric.with(this, new Crashlytics());