Code example for AudioManager

Methods: abandonAudioFocus

0
            mProgressRefresher.removeCallbacksAndMessages(null);
        } 
        if (mPlayer != null) {
            mPlayer.release();
            mPlayer = null;
            mAudioManager.abandonAudioFocus(mAudioFocusListener);
        } 
    } 
 
    @Override 
    public void onUserLeaveHint() { 
        stopPlayback(); 
        finish();
        super.onUserLeaveHint(); 
    } 
 
    public void onPrepared(MediaPlayer mp) {
        if (isFinishing()) return;
        mPlayer = (PreviewPlayer) mp;
        setNames(); 
        mPlayer.start();