Code example for MediaRouter

Methods: removeCallback

0
    protected void onPause() { 
        // Be sure to call the super class. 
        super.onPause(); 
 
        // Stop listening for changes to media routes. 
        mMediaRouter.removeCallback(mMediaRouterCallback);
 
        updateContents(); 
    } 
 
    @Override 
    protected void onStop() { 
        // Be sure to call the super class. 
        super.onStop(); 
 
        // Dismiss the presentation when the activity is not visible. 
        if (mPresentation != null) {
            Log.i(TAG,
                    "Dismissing presentation because the activity is no longer visible."); 
            mPresentation.dismiss();
            mPresentation = null;