diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java index d7ffad82..77cff1fc 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenter.java @@ -372,10 +372,9 @@ public class ControlCenter extends GBActivity { private void deleteDevice(final GBDevice gbDevice) { LOG.info("will try to delete device: " + gbDevice.getName()); - if (gbDevice.isConnected() || gbDevice.isConnected()) { + if (gbDevice.isConnected() || gbDevice.isConnecting()) { GBApplication.deviceService().disconnect(); } - GBApplication.deviceService().disconnect(); try (DBHandler dbHandler = GBApplication.acquireDB()) { DaoSession session = dbHandler.getDaoSession(); Device device = DBHelper.getDevice(gbDevice, session);