title: Stopping & starting music on incoming calls
body: <p>I have implemented an activity that plays media from a URL in Android.</p>
  
  <p>In order to add pause functionality when a call is incoming I created a receiver that sets a variable when the call is coming. The activity reads this variable in <code>onPause()</code>, pauses the music and resets it. When the call is done and the activity is resumed, the music is resumed in <code>onResume()</code>.</p>
  
  <p>This works fine as long the activity has the focus. If I go back to home screen while the music is playing, and then the call comes, <code>onPause()</code> is not called. Hence, I can't stop and start the music.</p>
  
  <p>Has anybody implemented a media player that intercepts incoming/outgoing calls and stops/starts music correctly?</p>