android蓝牙配对请求

android蓝牙配对请求,android,bluetooth,Android,Bluetooth,你能帮我吗?我如何检查用户是否拒绝了蓝牙配对请求?您现在不太容易。由于平台对您隐藏了这一点,因此唯一的选择是在用户按下蓝牙配对请求屏幕上的“取消”后,立即检查前后的绑定设备列表 意图与行动 android.bluetooth.BluetoothDevice.ACTION\u BOND\u STATE\u已更改 激发,并在其内部绑定int键 android.bluetooth.BluetoothDevice.EXTRA\u BOND\u状态 有价值 android.bluetooth Blueto

你能帮我吗?我如何检查用户是否拒绝了蓝牙配对请求?

您现在不太容易。由于平台对您隐藏了这一点,因此唯一的选择是在用户按下蓝牙配对请求屏幕上的“取消”后,立即检查前后的绑定设备列表

意图与行动

android.bluetooth.BluetoothDevice.ACTION\u BOND\u STATE\u已更改

激发,并在其内部绑定int键

android.bluetooth.BluetoothDevice.EXTRA\u BOND\u状态

有价值

android.bluetooth BluetoothDevice.BONE\u无

例如,在为操作注册广播接收器后,获取int值,如下所示。 然后您将知道用户是否在配对屏幕上按了取消

if (intent.getExtras().getInt(BluetoothDevice.EXTRA_BOND_STATE) == BluetoothDevice.BOND_NONE) {
}