Code example for Handler

Methods: removeCallbacksAndMessages

0
        super.onDestroy(); 
    } 
 
    private void stopPlayback() { 
        if (mProgressRefresher != null) {
            mProgressRefresher.removeCallbacksAndMessages(null);
        } 
        if (mPlayer != null) {
            mPlayer.release();
            mPlayer = null;
            mAudioManager.abandonAudioFocus(mAudioFocusListener);
        } 
    } 
 
    @Override 
    public void onUserLeaveHint() { 
        stopPlayback(); 
        finish();
        super.onUserLeaveHint(); 
    }