Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:mediarouter-v7:27.0.0

MediaRouteSelector

public final class MediaRouteSelector
extends Object

java.lang.Object
   ↳ android.support.v7.media.MediaRouteSelector


Describes the capabilities of routes that applications would like to discover and use.

This object is immutable once created using a MediaRouteSelector.Builder instance.

Example

 MediaRouteSelector selectorBuilder = new MediaRouteSelector.Builder()
         .addControlCategory(MediaControlIntent.CATEGORY_LIVE_VIDEO)
         .addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)
         .build();

 MediaRouter router = MediaRouter.getInstance(context);
 router.addCallback(selector, callback, MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);
 

Summary

Nested classes

class MediaRouteSelector.Builder

Builder for media route selectors

Fields

public static final MediaRouteSelector EMPTY

An empty media route selector that will not match any routes.

Public methods

Bundle asBundle()

Converts this object to a bundle for serialization.

boolean contains(MediaRouteSelector selector)

Returns true if this selector contains all of the capabilities described by the specified selector.

boolean equals(Object o)
static MediaRouteSelector fromBundle(Bundle bundle)

Creates an instance from a bundle.

List<String> getControlCategories()

Gets the list of media control categories in the selector.

boolean hasControlCategory(String category)

Returns true if the selector contains the specified category.

int hashCode()
boolean isEmpty()

Returns true if the selector does not specify any capabilities.

boolean isValid()

Returns true if the selector has all of the required fields.

boolean matchesControlFilters(List<IntentFilter> filters)

Returns true if the selector matches at least one of the specified control filters.

String toString()

Inherited methods

From class java.lang.Object

Fields

EMPTY

added in version 22.1.0
MediaRouteSelector EMPTY

An empty media route selector that will not match any routes.

Public methods

asBundle

added in version 22.1.0
Bundle asBundle ()

Converts this object to a bundle for serialization.

Returns
Bundle The contents of the object represented as a bundle.

contains

added in version 22.1.0
boolean contains (MediaRouteSelector selector)

Returns true if this selector contains all of the capabilities described by the specified selector.

Parameters
selector MediaRouteSelector: The selector to be examined.

Returns
boolean True if this selector contains all of the capabilities described by the specified selector.

equals

boolean equals (Object o)

Parameters
o Object

Returns
boolean

fromBundle

added in version 22.1.0
MediaRouteSelector fromBundle (Bundle bundle)

Creates an instance from a bundle.

Parameters
bundle Bundle: The bundle, or null if none.

Returns
MediaRouteSelector The new instance, or null if the bundle was null.

getControlCategories

added in version 22.1.0
List<String> getControlCategories ()

Gets the list of media control categories in the selector.

Returns
List<String> The list of categories.

hasControlCategory

added in version 22.1.0
boolean hasControlCategory (String category)

Returns true if the selector contains the specified category.

Parameters
category String: The category to check.

Returns
boolean True if the category is present.

hashCode

int hashCode ()

Returns
int

isEmpty

added in version 22.1.0
boolean isEmpty ()

Returns true if the selector does not specify any capabilities.

Returns
boolean

isValid

added in version 22.1.0
boolean isValid ()

Returns true if the selector has all of the required fields.

Returns
boolean

matchesControlFilters

added in version 22.1.0
boolean matchesControlFilters (List<IntentFilter> filters)

Returns true if the selector matches at least one of the specified control filters.

Parameters
filters List: The list of control filters to consider.

Returns
boolean True if a match is found.

toString

String toString ()

Returns
String

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)