From e97b1765299b87d83e39801ac3cb261a79f7a3f5 Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Mon, 15 Oct 2018 21:57:17 +0200 Subject: [PATCH] Stop timeout handler before connecting to scale --- .../openscale/core/bluetooth/BluetoothCommunication.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java index 480f6b19..218d660c 100644 --- a/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java +++ b/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothCommunication.java @@ -468,7 +468,8 @@ public abstract class BluetoothCommunication { if (!device.getAddress().equals(hwAddress)) { return; } - // Stop scan and connect to the device on the main thread + // Stop timeout and connect to the device on the main thread + handler.removeCallbacksAndMessages(leScanCallback); handler.post(new Runnable() { @Override public void run() {