android蓝牙配对请求

时间:2010-11-01 12:15:29

标签: android bluetooth

你可以帮帮我吗?如何判断用户是否拒绝了蓝牙配对请求?

2 个答案:

答案 0 :(得分:3)

用户在蓝牙配对请求屏幕上按下取消,

意图采取行动

  

android.bluetooth.BluetoothDevice.ACTION_BOND_STATE_CHANGED

被触发,在其中,使用int key

捆绑
  

android.bluetooth.BluetoothDevice.EXTRA_BOND_STATE

有价值

  

android.bluetooth BluetoothDevice.BONE_NONE

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

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

答案 1 :(得分:1)

你现在不能轻易做到。因为平台隐藏了这个,所以唯一的选择是检查

之前和之后的绑定设备列表
相关问题