tags:

views:

81

answers:

1

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?

+2  A: 

You'll want to set up a BroadcastReceiver, looking for the "ACTION_HEADSET_PLUG" Intent.

http://developer.android.com/intl/zh-CN/reference/android/content/Intent.html#ACTION_HEADSET_PLUG

Adam