BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if(adapter != null)
{
    if(adapter.isEnabled()
    {
         Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
         startActivity(intent);
    }

    set<BluetoothDevice>devices = adapter.getBondedDevices();
    if(devices.size()>0)
    {
         for(Iterator iterator = devices.iterator();iterator.hasNext();)
        {
             BluetoothDevices bluetoothDevice =(BluetoothDevice)iterator.next();
        }
    }

}

相关文章:

  • 2021-12-26
  • 2021-11-22
  • 2021-12-26
  • 2022-01-16
  • 2022-12-23
  • 2021-12-26
  • 2022-02-06
  • 2021-09-25
猜你喜欢
  • 2021-12-26
  • 2021-08-02
  • 2022-02-07
  • 2021-12-26
  • 2021-05-17
相关资源
相似解决方案