MediaRouteChooserDialog
public class MediaRouteChooserDialog extends AppCompatDialog
| java.lang.Object | ||||
| ↳ | android.app.Dialog | |||
| ↳ | androidx.activity.ComponentDialog | |||
| ↳ | androidx.appcompat.app.AppCompatDialog | |||
| ↳ | androidx.mediarouter.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 | |
|---|---|
MediaRouteButton |
|
MediaRouteActionProvider |
Summary
Public constructors |
|---|
MediaRouteChooserDialog(@NonNull Context context) |
MediaRouteChooserDialog(@NonNull Context context, int theme) |
Public methods |
|
|---|---|
void |
dismiss() |
@NonNull MediaRouteSelector |
Gets the media route selector for filtering the routes that the user can select. |
void |
|
void |
|
boolean |
Returns true if the route should be included in the list. |
void |
onFilterRoutes(@NonNull List<MediaRouter.RouteInfo> routes)Called to filter the set of routes that should be included in the list. |
void |
Refreshes the list of routes that are shown in the chooser dialog. |
void |
setRouteSelector(@NonNull MediaRouteSelector selector)Sets the media route selector for filtering the routes that the user can select. |
void |
setTitle(@Nullable CharSequence title) |
void |
setTitle(int titleId) |
Inherited Constants |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited methods |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
MediaRouteChooserDialog
public MediaRouteChooserDialog(@NonNull Context context, int theme)
Public methods
getRouteSelector
public @NonNull MediaRouteSelector getRouteSelector()
Gets the media route selector for filtering the routes that the user can select.
| Returns | |
|---|---|
@NonNull MediaRouteSelector |
The selector, never null. |
onFilterRoute
public boolean onFilterRoute(@NonNull 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 | |
|---|---|
@NonNull MediaRouter.RouteInfo route |
The route to consider, never null. |
| Returns | |
|---|---|
boolean |
True if the route should be included in the chooser dialog. |
onFilterRoutes
public void onFilterRoutes(@NonNull 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 returns false.
| Parameters | |
|---|---|
@NonNull List<MediaRouter.RouteInfo> routes |
The list of routes to filter in-place, never null. |
refreshRoutes
public void refreshRoutes()
Refreshes the list of routes that are shown in the chooser dialog.
setRouteSelector
public void setRouteSelector(@NonNull MediaRouteSelector selector)
Sets the media route selector for filtering the routes that the user can select.
| Parameters | |
|---|---|
@NonNull MediaRouteSelector selector |
The selector, must not be null. |