From 119f4ba84c436397a07fe22c0d54f37fe092ca95 Mon Sep 17 00:00:00 2001 From: maxieds Date: Sat, 29 Jun 2019 19:14:40 -0400 Subject: [PATCH] Fixed a potential NullPointerException after recreate() is called when setting a new theme --- app/build.gradle | 4 ++-- .../chameleonminilivedebugger/LiveLoggerActivity.java | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fc49eef..d9b6c0a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { applicationId "com.maxieds.chameleonminilivedebugger" minSdkVersion 26 targetSdkVersion 28 - versionCode 59 - versionName "0.5.9" + versionCode 60 + versionName "0.6.0" //multiDexEnabled true buildConfigField "String", "GIT_COMMIT_HASH", "\"" + getGitCommitHash() + "\"" diff --git a/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java b/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java index 0c1b571..cb10f95 100644 --- a/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java +++ b/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java @@ -352,10 +352,11 @@ public void onReceive(Context context, Intent intent) { @Override public void recreate() { - unregisterReceiver(usbActionReceiver); - usbReceiversRegistered = false; - runningActivity = null; - + if(usbActionReceiver != null) { + unregisterReceiver(usbActionReceiver); + usbReceiversRegistered = false; + } + //runningActivity = null; //super.recreate(); Intent intent = getIntent(); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);