Code example for MediaRouter

Methods: removeCallback

0
  protected void onPause() { 
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
      clearPreso(); 
 
      if (router != null) {
        router.removeCallback(cb);
      } 
    } 
 
    super.onPause(); 
  } 
 
  @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
  private void handleRoute(RouteInfo route) {
    if (route == null) {
      clearPreso(); 
    } 
    else { 
      Display display=route.getPresentationDisplay();
 
      if (route.isEnabled() && display != null) {