how to handle media button to stop a song?
<p>I  have one service in which I am playing a song. Now I want to stop the song when i press volumn up and down button.</p>

<p>i used broadcast receiver also with the following code but it doesn't help me</p>

<p>if (intent.getAction().equals(Intent.ACTION_MEDIA_BUTTON))
 {
      player.stop();<br>
 }</p>

<p>please help me.</p>

<p>Thanks in advance     </p>
