Possible Duplicate:
Android: Checking if headphones are plugged in
Is there a way to check if earphones are connected to the Android device? Some kind of audio routing property or something?
Possible Duplicate:
Android: Checking if headphones are plugged in
Is there a way to check if earphones are connected to the Android device? Some kind of audio routing property or something?
You'll want to set up a BroadcastReceiver, looking for the "ACTION_HEADSET_PLUG" Intent.
https://developer.android.com/reference/android/content/Intent.html#ACTION_HEADSET_PLUG