Code example for MediaRouter

Methods: removeCallback

0
 
    @Override 
    public void onPause() { 
        super.onPause(); 
 
        mMediaRouter.removeCallback(mMediaRouterCallback);
        updateContents(); 
    } 
 
    @Override 
    public void onResume() { 
        super.onResume(); 
 
        mMediaRouter.addCallback(MediaRouter.ROUTE_TYPE_LIVE_VIDEO, mMediaRouterCallback);
        updatePresentation(); 
    } 
 
    @Override 
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present. 
        getMenuInflater().inflate(R.menu.video_presentation, menu);