added in version 22.1.0
belongs to Maven artifact


public final class MediaRouteSelector
extends Object


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

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


 MediaRouteSelector selectorBuilder = new MediaRouteSelector.Builder()

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


Nested classes

class MediaRouteSelector.Builder

Builder for media route selectors


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