![]() |
1
5
要进行简单检查,请使用以下命令。请记住将蓝牙权限添加到您的清单中(非危险权限)
|
![]() |
2
4
这是我的代码:
让我解释一下。您应该同时使用ProfileProxy和BroadcastReceiver。ProfileProxy允许您在应用程序运行之前检测耳机连接的情况。反过来,BroadcastReceiver可以让你在应用程序运行时检测耳机的连接/断开。 |
![]() |
3
2
我就是这样处理的。
创建了侦听器
引用自 Detect programatically if headphone or bluetooth headset attached with android phone
|
![]() |
Incog · 为什么没有检测到这个变量?安卓工作室Kotlin 1 年前 |
|
LuciaMS · 我可以获取其他wifi或蓝牙设备的MAC地址吗? 1 年前 |
![]() |
Flier Anonymous · 蓝牙中仅检测到一个设备 7 年前 |
![]() |
Jitu · 检测蓝牙耳机是否已连接 7 年前 |
![]() |
Master Crouch · Android BLE:成功将ENABLE\u NOTIFICATION\u VALUE写入BluetoothGattDescriptor,但onCharacteristicChanged从未触发 8 年前 |
|
user3956566 · 预配对蓝牙设备 9 年前 |