如何通过点击设备在发现后连接蓝牙设备? 有任何想法吗 ?请帮帮我
public void onReceive(Context context, Intent intent) {
String action =intent.getAction();
if(BluetoothDevice.ACTION_FOUND.equals(action)){
BluetoothDevice device =intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
marrayAdapter.add("Discovered:");
marrayAdapter.add(device.getName()+"\n"+device.getAddress());
}
}
};
IntentFilter filter =new IntentFilter(BluetoothDevice.ACTION_FOUND);
registerReceiver(mreceiver, filter);
mBlue.startDiscovery();
}