Belovoj
Belovoj

Reputation: 818

How to detect if external mic is plugged in (in real time) on android?

I need to detect if the external microphone is plugged in, but i need to do it in real time. Like when it is plugged in, i display "detected" icon, and when i unplug it, the icon should change to "not detected".

Upvotes: 2

Views: 1029

Answers (1)

HannahMitt
HannahMitt

Reputation: 1020

Register a BroadcastReceiver to get the ACTION_HEADSET_PLUG broadcast

Upvotes: 5

Related Questions