From d510c32f4c8b50850346aa3858da55cbe897b5a7 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Thu, 5 Jul 2018 23:05:51 +0200 Subject: [PATCH] Only restart scanning if dialog is showing --- .../health/openscale/gui/preferences/BluetoothPreferences.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android_app/app/src/main/java/com/health/openscale/gui/preferences/BluetoothPreferences.java b/android_app/app/src/main/java/com/health/openscale/gui/preferences/BluetoothPreferences.java index a2529f3e..bf3cf998 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/preferences/BluetoothPreferences.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/preferences/BluetoothPreferences.java @@ -307,7 +307,7 @@ public class BluetoothPreferences extends PreferenceFragment { super.onStart(); // Restart discovery after e.g. orientation change - if (btScanner.getDialog() != null) { + if (btScanner.getDialog() != null && btScanner.getDialog().isShowing()) { startBluetoothDiscovery(); } }