diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java index 5b0d5549f..81a5a2f62 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java @@ -249,7 +249,13 @@ public class DiscoveryActivity extends Activity implements AdapterView.OnItemCli private void bluetoothStateChanged(int oldState, int newState) { discoveryFinished(); - startButton.setEnabled(newState == BluetoothAdapter.STATE_ON); + if (newState == BluetoothAdapter.STATE_ON) { + this.adapter = BluetoothAdapter.getDefaultAdapter(); + startButton.setEnabled(true); + } else { + this.adapter = null; + startButton.setEnabled(false); + } } private void discoveryFinished() { @@ -286,6 +292,8 @@ public class DiscoveryActivity extends Activity implements AdapterView.OnItemCli BluetoothAdapter adapter = bluetoothService.getAdapter(); if (!adapter.isEnabled()) { LOG.warn("Bluetooth not enabled"); + Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); + startActivity(enableBtIntent); this.adapter = null; return false; } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5978634eb..25a6f77ec 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -116,7 +116,7 @@ No valid user data given, using dummy user data for now. When your Mi Band vibrates and blinks, tap it a few times in a row. Install - Make your device discoverable. Currently connected devices will likely not be discovered. + Make your device discoverable. Currently connected devices will likely not be discovered. If your device does not show up after two minutes, try again after rebooting your mobile device. Note: Device Image Name/Alias