(New to android programming)

I'm trying to detect whether a headset is plugged into the audio jack in my 
android application, but I'm having trouble finding resources that clearly 
explain how to do it.

>From my searching, I think you have to add the following to the manifest:

<receiver android:enabled="true" android:name=".AudioJackReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.HEADSET_PLUG" >
                </action>
            </intent-filter>
        </receiver>

And then I made an extension of BroadcastReceiver called AudioJackReceiver. 
But when I plug in my headphones, it doesn't seem to be called. How do I 
get it to work? 

Any help would be appreciated.

Thank you

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to