When should a music player gain and give up audio focus?
<p>I'm writing an Android music player, and is stuck on audio focus issue.</p>

<p>It seems like audio focus mainly affects media button receiving, but after reading the document I have no idea about when to gain and give up focus.</p>

<p>My music app will run in background, and need to detect play/pause button <strong>every time</strong>. That is, even when my app is not running, a user should be able to press headset's play button and start music.</p>

<p>It seems I should never give up audio focus, so why should I implement it?</p>

<p>Does anyone know practically how audio focus should be used? Thank you!</p>
