小智 5
一旦用户在蓝牙配对请求屏幕上按下取消,
意图与行动
android.bluetooth.BluetoothDevice.ACTION_BOND_STATE_CHANGED
被解雇,并在其中捆绑了 int 键
android.bluetooth.BluetoothDevice.EXTRA_BOND_STATE
有价值
android.bluetooth BluetoothDevice.BONE_NONE
例如,在为动作注册广播接收器后,获取如下所示的 int 值。然后你就会知道用户是否在配对屏幕上按下了取消。
if (intent.getExtras().getInt(BluetoothDevice.EXTRA_BOND_STATE) == BluetoothDevice.BOND_NONE) {
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2529 次 |
| 最近记录: |