1
我是刚接触android并尝试以编程方式连接BluetoothDevice。设备有一个PIN。连接到设备是在另一个线程比UI。到目前为止,我已经遵循How to programmatically pair a bluetooth device on Android的示例。Android:隐藏配对对话框
对BluetoothDevice.ACTION_PAIRING_REQUEST我将字符串转换为byte []并执行setPin调用。配对对话框弹出并消失。像
Method createBondMethod1 = device.getClass().getMethod("cancelPairingUserInput"); Boolean returnValue2 = (Boolean) createBondMethod1.invoke(device);
的任何行动都未能上setPin。 当调用device.createBond()时触发BluetoothDevice.ACTION_PAIRING_REQUEST。
问题是我该如何隐藏配对对话框?
谢谢。