public class MediaRouteChooserDialog extends AppCompatDialog
MediaRouter
.
This dialog allows the user to choose a route that matches a given selector.
MediaRouteButton
,
MediaRouteActionProvider
DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnShowListener
mCancelable
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, BUTTON1, BUTTON2, BUTTON3
Constructor and Description |
---|
MediaRouteChooserDialog(Context context) |
MediaRouteChooserDialog(Context context,
int theme) |
Modifier and Type | Method and Description |
---|---|
MediaRouteSelector |
getRouteSelector()
Gets the media route selector for filtering the routes that the user can select.
|
void |
onAttachedToWindow()
Called when the window has been attached to the window manager.
|
protected void |
onCreate(Bundle savedInstanceState)
Similar to
Activity.onCreate(android.os.Bundle) , you should initialize your dialog
in this method, including calling Dialog.setContentView(int) . |
void |
onDetachedFromWindow()
Called when the window has been attached to the window manager.
|
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.
|
addContentView, findViewById, getDelegate, getSupportActionBar, invalidateOptionsMenu, onStop, onSupportActionModeFinished, onSupportActionModeStarted, onWindowStartingSupportActionMode, setContentView, setContentView, setContentView, setTitle, setTitle, supportRequestWindowFeature
cancel, closeOptionsMenu, create, dismiss, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, isShowing, onActionModeFinished, onActionModeStarted, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onStart, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowDismissed, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setVolumeControlStream, show, takeCancelAndDismissListeners, takeKeyEvents, unregisterForContextMenu
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onProvideKeyboardShortcuts
public MediaRouteChooserDialog(Context context)
public MediaRouteChooserDialog(Context context, int theme)
@NonNull public MediaRouteSelector getRouteSelector()
public void setRouteSelector(@NonNull MediaRouteSelector selector)
selector
- The selector, must not be null.public void onFilterRoutes(@NonNull List<MediaRouter.RouteInfo> routes)
The default implementation iterates over all routes in the provided list and
removes those for which onFilterRoute(android.support.v7.media.MediaRouter.RouteInfo)
returns false.
routes
- The list of routes to filter in-place, never null.public boolean onFilterRoute(@NonNull MediaRouter.RouteInfo route)
The default implementation returns true for enabled non-default routes that match the selector. Subclasses can override this method to filter routes differently.
route
- The route to consider, never null.protected void onCreate(Bundle savedInstanceState)
Dialog
Activity.onCreate(android.os.Bundle)
, you should initialize your dialog
in this method, including calling Dialog.setContentView(int)
.onCreate
in class AppCompatDialog
savedInstanceState
- If this dialog is being reinitialized after a
the hosting activity was previously shut down, holds the result from
the most recent call to Dialog.onSaveInstanceState()
, or null if this
is the first time.public void onAttachedToWindow()
Window.Callback
View.onAttachedToWindow()
for more information.onAttachedToWindow
in interface Window.Callback
onAttachedToWindow
in class Dialog
public void onDetachedFromWindow()
Window.Callback
View.onDetachedFromWindow()
for more information.onDetachedFromWindow
in interface Window.Callback
onDetachedFromWindow
in class Dialog
public void refreshRoutes()