samples/Support4Demos/src/main/java/com/example/android/supportv4/media/Playback.java
private void relaxResources(boolean releaseMediaPlayer) {
        Log.d(TAG, "relaxResources. releaseMediaPlayer=" + releaseMediaPlayer);

        mService.stopForeground(true);

        // stop and release the Media Player, if it's available
        if (releaseMediaPlayer && mMediaPlayer != null) {
            mMediaPlayer.reset();
            mMediaPlayer.release();
            mMediaPlayer = null;
        }

        // we can also release the Wifi lock, if we're holding it
        if (mWifiLock.isHeld()) {
            mWifiLock.release();
        }
    }
/**
     * Releases resources used by the service for playback. This includes the
     * "foreground service" status, the wake locks and possibly the MediaPlayer.
     *
     * @param releaseMediaPlayer Indicates whether the Media Player should also
     *            be released or not
     */
Releases resources used by the service for playback. This includes the
"foreground service" status, the wake locks and possibly the MediaPlayer.

@param releaseMediaPlayer Indicates whether the Media Player should also
be released or not
Releases resources used by the service for playback . This includes the " foreground service " status the wake locks and possibly the MediaPlayer . @param releaseMediaPlayer Indicates whether the Media Player should also be released or not
private void relaxResources(boolean releaseMediaPlayer) {
        Log.d(TAG, "relaxResources. releaseMediaPlayer=" + releaseMediaPlayer);
        mService.stopForeground(true);
        if (releaseMediaPlayer && mMediaPlayer != null) {
            mMediaPlayer.reset();
            mMediaPlayer.release();
            mMediaPlayer = null;
        }
        if (mWifiLock.isHeld()) {
            mWifiLock.release();
        }
    }
private void relaxResources ( boolean releaseMediaPlayer ) { Log . d ( TAG , "relaxResources. releaseMediaPlayer=" + releaseMediaPlayer ) ; mService . stopForeground ( true ) ; if ( releaseMediaPlayer && mMediaPlayer != null ) { mMediaPlayer . reset ( ) ; mMediaPlayer . release ( ) ; mMediaPlayer = null ; } if ( mWifiLock . isHeld ( ) ) { mWifiLock . release ( ) ; } }
Releases resources used by the service for playback.
Releases resources used by the service for playback .
// stop and release the Media Player, if it's available // we can also release the Wifi lock, if we're holding it