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:
parent
2f3a2116fb
commit
91bd2c5b4f
|
@ -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());
|
||||||
|
|
Loading…
Reference in a new issue