Vis*_*ruz 5 android bluetooth a2dp
我有一个要求,其中我有一个通过蓝牙连接到我的手机的配对设备列表。在某些时候,我必须禁用/启用与我的配对设备共享媒体或联系方式。我的要求是在 android 中以编程方式执行此操作。我已经搜索过这个,但找不到任何解决方案。
请告诉我是否可以?
只需尝试启用或禁用蓝牙即可。
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter.isEnabled()) {
mBluetoothAdapter.disable();
}else {
mBluetoothAdapter.enable();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1929 次 |
| 最近记录: |