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

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

Best Java code snippets using android.support.v7.media.MediaRouter$RouteInfo.supportsControlRequest (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

/**
 * Send the given intent to the current route. The result will be returned in the given
 * ResultBundleHandler. This function will also check to see if the current route can handle the
 * intent before sending it.
 *
 * @param intent the intent to send to the current route.
 * @param bundleHandler contains the result of sending the intent
 */
private void sendIntentToRoute(final Intent intent, final ResultBundleHandler bundleHandler) {
  if (getCurrentRoute() == null) {
    logIntent("sendIntentToRoute ", intent);
    Log.d(TAG, "The current route is null.");
    if (bundleHandler != null) bundleHandler.onError(null, null);
    return;
  }
  if (!getCurrentRoute().supportsControlRequest(intent)) {
    logIntent("sendIntentToRoute ", intent);
    Log.d(TAG, "The intent is not supported by the route: %s", getCurrentRoute());
    if (bundleHandler != null) bundleHandler.onError(null, null);
    return;
  }
  sendControlIntent(intent, bundleHandler);
}
android.support.v7.mediaMediaRouter$RouteInfosupportsControlRequest

Popular methods of MediaRouter$RouteInfo

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best plugins for Eclipse
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