Prevent double crash reports

This commit is contained in:
M66B 2019-08-11 13:36:18 +02:00
parent 3222b3695b
commit 6dd3159be0
1 changed files with 4 additions and 1 deletions

View File

@ -73,12 +73,15 @@ public class ApplicationEx extends Application {
logMemory("App create version=" + BuildConfig.VERSION_NAME);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
final boolean crash_reports = prefs.getBoolean("crash_reports", false);
prev = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
if (ownFault(ex)) {
if (!crash_reports && ownFault(ex)) {
Log.e(ex);
if (BuildConfig.BETA_RELEASE ||