gpt4 book ai didi

android - 连接蓝牙设备时如何防止android选择Bluetooth A2DP路由

转载 作者:行者123 更新时间:2023-12-03 02:05:01 25 4
gpt4 key购买 nike

我正在使用MediaRouter(来自v7支持库),并以编程方式为我的特定设备路由选择音频的路由,但是当连接了某些蓝牙A2DP设备时,Android会自动选择与该蓝牙设备关联的路由。

如何防止它从我已经选择并想要的路线切换?

最佳答案

好吧,到目前为止似乎还没有办法。
自动切换到蓝牙A2DP路由被硬编码到Android框架MediaRouter class

This will select the active BT route if there is one and the current selected route is the default system route, or if there is no selected route yet.


因此,如果您当前的路由为默认路由,则将自动选择BT A2DP路由。可以监听 onRouteSelected回调并选择默认的路由返回。

关于android - 连接蓝牙设备时如何防止android选择Bluetooth A2DP路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28157233/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com