mirror of
https://github.com/adolfintel/OpenPods.git
synced 2026-09-16 15:36:12 -04:00
Fixed a problem in BLE detection
This commit is contained in:
@@ -25,7 +25,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
//check if Bluetooth LE is available on this device. If not, show an error
|
//check if Bluetooth LE is available on this device. If not, show an error
|
||||||
BluetoothAdapter btAdapter=((BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter();
|
BluetoothAdapter btAdapter=((BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter();
|
||||||
if(btAdapter==null||((BluetoothAdapter) btAdapter).getBluetoothLeScanner()==null){
|
if(btAdapter==null||(btAdapter.isEnabled()&&btAdapter.getBluetoothLeScanner()==null)){
|
||||||
Intent i=new Intent(this,NoBTActivity.class);
|
Intent i=new Intent(this,NoBTActivity.class);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
|
|||||||
Reference in New Issue
Block a user