|
|
1
5
要进行简单检查,请使用以下命令。请记住将蓝牙权限添加到您的清单中(非危险权限)
|
|
|
2
4
这是我的代码:
让我解释一下。您应该同时使用ProfileProxy和BroadcastReceiver。ProfileProxy允许您在应用程序运行之前检测耳机连接的情况。反过来,BroadcastReceiver可以让你在应用程序运行时检测耳机的连接/断开。 |
|
|
3
2
我就是这样处理的。
创建了侦听器
引用自 Detect programatically if headphone or bluetooth headset attached with android phone
|