Code example for MediaRouter

Methods: getSelectedRoute

0
                if (selectedRoute != null) {
                    selectedRoute.requestUpdateVolume(-1);
                    return true; 
                } 
            } else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP && mVolumeSlider.isEnabled()) {
                final RouteInfo selectedRoute = mRouter.getSelectedRoute(mRouteTypes);
                if (selectedRoute != null) {
                    mRouter.getSelectedRoute(mRouteTypes).requestUpdateVolume(1);
                    return true; 
                } 
            } 
            return super.onKeyDown(keyCode, event);
        } 
 
        public boolean onKeyUp(int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN && mVolumeSlider.isEnabled()) {
                return true; 
            } else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP && mVolumeSlider.isEnabled()) {
                return true; 
            } else { 
Connect your IDE to all the code out there  Get Codota for Java