Issue
How can I determine whether a headset is plugged into an Android device or not?
Solution
When you say "headset", do you mean "wired headset"? If so, there's an intent to detect whether or not one is being plugged or unplugged: ACTION_HEADSET_PLUG
.
To check the status, you can use AudioManager.isWiredHeadsetOn()
, although that may return false if there is also a bluetooth headset, and audio is routed to that instead.
Answered By - EboMike
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.