From 0ef1aea4deee24dd2b13c1817245b137310c8320 Mon Sep 17 00:00:00 2001 From: maxieds Date: Sat, 12 May 2018 11:47:47 -0400 Subject: [PATCH] Attempt to fix super.NotFound ANR reports... --- app/build.gradle | 4 ++-- .../chameleonminilivedebugger/LiveLoggerActivity.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 36beece..329cb26 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,8 +26,8 @@ android { applicationId "com.maxieds.chameleonminilivedebugger" minSdkVersion 21 targetSdkVersion 27 - versionCode 41 - versionName "0.4.1" + versionCode 42 + versionName "0.4.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true } diff --git a/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java b/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java index 35aad81..b1ba3f8 100644 --- a/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java +++ b/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java @@ -189,6 +189,7 @@ public void uncaughtException(Thread thread, Throwable ex) { String msgParam = "An unknown error happened in the app. Please upgrade to the latest version if a newer one is available, or "; msgParam += "contact the developer at maxieds@gmail.com to report whatever action you took to generate this error!"; appendNewLog(LogEntryMetadataRecord.createDefaultEventRecord("UNRECOGNIZED EXCEPTION", msgParam)); + System.exit(-1); } }; @@ -201,11 +202,11 @@ public void uncaughtException(Thread thread, Throwable ex) { protected void onCreate(Bundle savedInstanceState) { // fix bug where the tabs are blank when the application is relaunched: + super.onCreate(savedInstanceState); // should fix most of the crashes in the ANR report on Play Store + if(!BuildConfig.DEBUG) + Fabric.with(this, new Crashlytics()); if(runningActivity == null || !isTaskRoot()) { - super.onCreate(savedInstanceState); Thread.setDefaultUncaughtExceptionHandler(unCaughtExceptionHandler); - if(!BuildConfig.DEBUG) - Fabric.with(this, new Crashlytics()); } if(!isTaskRoot()) { Log.w(TAG, "ReLaunch Intent Action: " + getIntent().getAction());