Android: Checking if headphones are plugged in
<p>How can I check if headphones are currently plugged in. I don't want a broadcastreceiver which informs me when they have been connected to the device. I need something like:</p>

<pre><code>if(/*headphone is connected*/)
 ...
</code></pre>
