Commit 9e30bc8d authored by Kristin Muterspaw's avatar Kristin Muterspaw
Browse files

App no longer dies if user denies turning on bluetooth. Previous page is shown.

parent c4fa2362
......@@ -90,7 +90,7 @@ public class SensorScanActivity extends ListActivity {
}
@Override
public void onPause(){
public void onPause() {
super.onPause();
if (btAdapter.isEnabled()){
scanLeDevice(false);
......@@ -119,8 +119,10 @@ public class SensorScanActivity extends ListActivity {
public void onStop() {
super.onStop();
scanLeDevice(false);
mLeDeviceListAdapter.clear();
if (btAdapter.isEnabled()) {
scanLeDevice(false);
mLeDeviceListAdapter.clear();
}
}
public void onStart() {
......@@ -132,7 +134,6 @@ public class SensorScanActivity extends ListActivity {
// User chose not to enable Bluetooth.
if (requestCode == REQUEST_ENABLE_BT && resultCode == Activity.RESULT_CANCELED) {
finish();
return;
} else if (requestCode == REQUEST_ENABLE_BT && resultCode == Activity.RESULT_OK){
btScanner = btAdapter.getBluetoothLeScanner();
settings = new ScanSettings.Builder()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment