Detecting state changes made to the BluetoothAdapter?

前端 未结 2 566
不思量自难忘°
不思量自难忘° 2020-11-27 12:33

I have an app with a button on it that I use to turn BT on and off. I have the following code in there;

public void buttonFlip(View view) {
    flipBT();
            


        
2条回答
  •  -上瘾入骨i
    2020-11-27 12:39

    public void discoverBluetoothDevices(View view)
        {
            if (bluetoothAdapter!=null)
    
                bluetoothAdapter.startDiscovery();
                Toast.makeText(this,"Start Discovery"+bluetoothAdapter.startDiscovery(),Toast.LENGTH_SHORT).show();
        }
    

提交回复
热议问题