Tabnine Logo
MediaRouter$RouteInfo.sendControlRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
sendControlRequest
method
in
android.support.v7.media.MediaRouter$RouteInfo

Best Java code snippets using android.support.v7.media.MediaRouter$RouteInfo.sendControlRequest (Showing top 2 results out of 315)

origin: googlesamples/android-MediaRouter

@Override
public void updateStatistics() {
  // clear stats info first
  mStatsInfo = "";
  Intent intent = new Intent(SampleMediaRouteProvider.ACTION_GET_STATISTICS);
  intent.addCategory(SampleMediaRouteProvider.CATEGORY_SAMPLE_ROUTE);
  if (mRoute != null && mRoute.supportsControlRequest(intent)) {
    ControlRequestCallback callback = new ControlRequestCallback() {
      @Override
      public void onResult(Bundle data) {
        if (DEBUG) {
          Log.d(TAG, "getStatistics: succeeded: data=" + data);
        }
        if (data != null) {
          int playbackCount = data.getInt(
              SampleMediaRouteProvider.DATA_PLAYBACK_COUNT, -1);
          mStatsInfo = "Total playback count: " + playbackCount;
        }
      }
      @Override
      public void onError(String error, Bundle data) {
        Log.d(TAG, "getStatistics: failed: error=" + error + ", data=" + data);
      }
    };
    mRoute.sendControlRequest(intent, callback);
  }
}
origin: derry/delion

private void sendControlIntent(final Intent intent, final ResultBundleHandler bundleHandler) {
  Log.d(TAG, "Sending intent to %s %s", getCurrentRoute().getName(),
      getCurrentRoute().getId());
  logIntent("sendControlIntent ", intent);
  if (getCurrentRoute().isDefault()) {
    Log.d(TAG, "Route is default, not sending");
    return;
  }
  getCurrentRoute().sendControlRequest(intent, new MediaRouter.ControlRequestCallback() {
    @Override
    public void onResult(Bundle data) {
      if (data != null && bundleHandler != null) bundleHandler.onResult(data);
    }
    @Override
    public void onError(String message, Bundle data) {
      logControlRequestError(intent, message, data);
      int errorCode = 0;
      if (data != null) {
        errorCode = data.getInt(CastMediaControlIntent.EXTRA_ERROR_CODE);
      }
      sendErrorToListeners(errorCode);
      if (bundleHandler != null) bundleHandler.onError(message, data);
    }
  });
}
android.support.v7.mediaMediaRouter$RouteInfosendControlRequest

Popular methods of MediaRouter$RouteInfo

  • getName
  • getDescription
  • getId
  • getPlaybackType
  • getVolumeHandling
  • isConnecting
  • isSelected
  • select
  • supportsControlCategory
  • supportsControlRequest
  • getExtras
  • getPlaybackStream
  • getExtras,
  • getPlaybackStream,
  • getPresentationDisplay,
  • getProvider,
  • getVolume,
  • getVolumeMax,
  • isDefault,
  • isEnabled,
  • matchesSelector

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • setContentView (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now