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

MediaRouteChooserDialog

public class MediaRouteChooserDialog
extends AppCompatDialog

java.lang.Object
   ↳ android.app.Dialog
     ↳ android.support.v7.app.AppCompatDialog
       ↳ android.support.v7.app.MediaRouteChooserDialog


This class implements the route chooser dialog for MediaRouter.

This dialog allows the user to choose a route that matches a given selector.

See also:

Summary

Inherited constants

From interface android.content.DialogInterface

Public constructors

MediaRouteChooserDialog(Context context)
MediaRouteChooserDialog(Context context, int theme)

Public methods

MediaRouteSelector getRouteSelector()

Gets the media route selector for filtering the routes that the user can select.

void onAttachedToWindow()
void onDetachedFromWindow()
boolean onFilterRoute(MediaRouter.RouteInfo route)

Returns true if the route should be included in the list.

void onFilterRoutes(List<MediaRouter.RouteInfo> routes)

Called to filter the set of routes that should be included in the list.

void refreshRoutes()

Refreshes the list of routes that are shown in the chooser dialog.

void setRouteSelector(MediaRouteSelector selector)

Sets the media route selector for filtering the routes that the user can select.

void setTitle(CharSequence title)
void setTitle(int titleId)

Protected methods

void onCreate(Bundle savedInstanceState)

Inherited methods

From class android.support.v7.app.AppCompatDialog
From class android.app.Dialog
From class java.lang.Object
From interface android.support.v7.app.AppCompatCallback
From interface android.content.DialogInterface
From interface android.view.Window.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnCreateContextMenuListener

Public constructors

MediaRouteChooserDialog

added in version 22.1.0
MediaRouteChooserDialog (Context context)

Parameters
context Context

MediaRouteChooserDialog

added in version 22.1.0
MediaRouteChooserDialog (Context context, 
                int theme)

Parameters
context Context

theme int

Public methods

getRouteSelector

added in version 22.1.0
MediaRouteSelector getRouteSelector ()

Gets the media route selector for filtering the routes that the user can select.

Returns
MediaRouteSelector The selector, never null.

onAttachedToWindow

void onAttachedToWindow ()

onDetachedFromWindow

void onDetachedFromWindow ()

onFilterRoute

added in version 22.1.0
boolean onFilterRoute (MediaRouter.RouteInfo route)

Returns true if the route should be included in the list.

The default implementation returns true for enabled non-default routes that match the selector. Subclasses can override this method to filter routes differently.

Parameters
route MediaRouter.RouteInfo: The route to consider, never null.

Returns
boolean True if the route should be included in the chooser dialog.

onFilterRoutes

added in version 22.1.0
void onFilterRoutes (List<MediaRouter.RouteInfo> routes)

Called to filter the set of routes that should be included in the list.

The default implementation iterates over all routes in the provided list and removes those for which onFilterRoute(MediaRouter.RouteInfo) returns false.

Parameters
routes List: The list of routes to filter in-place, never null.

refreshRoutes

added in version 22.1.0
void refreshRoutes ()

Refreshes the list of routes that are shown in the chooser dialog.

setRouteSelector

added in version 22.1.0
void setRouteSelector (MediaRouteSelector selector)

Sets the media route selector for filtering the routes that the user can select.

Parameters
selector MediaRouteSelector: The selector, must not be null.

setTitle

void setTitle (CharSequence title)

Parameters
title CharSequence

setTitle

void setTitle (int titleId)

Parameters
titleId int

Protected methods

onCreate

void onCreate (Bundle savedInstanceState)

Parameters
savedInstanceState Bundle

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.
(Sep 2017 survey)