Android how to answer phone, etc with headset button?
<p>I'm not sure how to get started here so I'll ask a fairly general question. </p>

<p>Let's say I have a plug-in headset with a button. Now if I have an incoming phone call, can I programmatically make it so that when the user clicks the button on the headset, it answers (or rejects) the call? I can already register the headset clicks so that's not an issue. Also eventually I need to do a multitude of functions such as play/pause music with the button (if the music player is open). </p>

<p>Mostly I'm just looking to be pointed in the right direction. Thanks.</p>
