I made an app that plays back audio files, and has an option to switch the audio path between the headset, speaker, and a BT headset. However, I can't figure out a way to have the app detect if there is a BT headset connected. I can check if BT is enabled or disabled, and I can check if there are any devices paired, but not if any are connected. The only thing I can do for now is use a BroadcastReceiver to see 开发者_JS百科when the "android.bluetooth.headset.action.STATE_CHANGED" broadcast is made and check if it's connected. However, this only work when the headset is connected or disconnected. I'd like a solution that would let my app check th BT headset state whenever it needs to. How can this be done?
How to detect if BT headset is connected in Android SDK?
I made an app that plays back audio files, and has an option to switch the audio path between the headset, speaker, and a BT headset. However, I can\'t figure out a way to have the app detect if there
0
0
0
精彩评论