Stop a service when OnAudioFocusChangeListener when =AudioManager.AUDIOFOCUS_LOSS
<p>I am having trouble stopping my media player class, that extends service.  I can call stop just fine but am getting a force close when trying to use stopService(Intent).  I get nullpointer exceptions in the log related to the context.  I cannot find any documentation on the web about this.  Here is the part of my code that I have tried:</p>

<pre><code>static OnAudioFocusChangeListener audioFocusChangeListener = new OnAudioFocusChangeListener()
{
    public void onAudioFocusChange(int focusChange)
    {
        if (focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT)
        {
            mp.setVolume(0.01f, 0.01f);
        }
        else if (focusChange == AudioManager.AUDIOFOCUS_GAIN)
        {
            mp.setVolume(1.0f, 1.0f);
        }
        else if (focusChange == AudioManager.AUDIOFOCUS_LOSS)
        {

                //stop playback and release everything---------------still need to confirm this is working
                Play playService = new Play();
                playService.stopPlaying();
                //playService.stopAllServices();
                //Intent stopPlayingService = new Intent("com.joebutt.mouseworldradio.Play");
                //playService.getApplicationContext();
                //Context context = (Context) OnAudioFocusChangeListener.this;
                Intent stopPlayingService = new Intent(playService.getBaseContext(), Play.class);
                //stopPlayingService.setAction(Intent.);
                //stopService(stopPlayingService);
                playService.stopService(stopPlayingService);


        }
    }
};
</code></pre>
