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

MediaRouteControllerDialog

public class MediaRouteControllerDialog
extends AlertDialog

java.lang.Object
   ↳ android.app.Dialog
     ↳ android.support.v7.app.AppCompatDialog
       ↳ android.support.v7.app.AlertDialog
         ↳ android.support.v7.app.MediaRouteControllerDialog


This class implements the route controller dialog for MediaRouter.

This dialog allows the user to control or disconnect from the currently selected route.

See also:

Summary

Inherited constants

From interface android.content.DialogInterface

Public constructors

MediaRouteControllerDialog(Context context)
MediaRouteControllerDialog(Context context, int theme)

Public methods

View getMediaControlView()

Gets the media control view that was created by onCreateMediaControlView(Bundle).

MediaSessionCompat.Token getMediaSession()

Gets the session to use for metadata and transport controls.

MediaRouter.RouteInfo getRoute()

Gets the route that this dialog is controlling.

boolean isVolumeControlEnabled()

Returns whether to enable the volume slider and volume control using the volume keys when the route supports it.

void onAttachedToWindow()
View onCreateMediaControlView(Bundle savedInstanceState)

Provides the subclass an opportunity to create a view that will replace the default media controls for the currently playing content.

void onDetachedFromWindow()
boolean onKeyDown(int keyCode, KeyEvent event)
boolean onKeyUp(int keyCode, KeyEvent event)
void setVolumeControlEnabled(boolean enable)

Sets whether to enable the volume slider and volume control using the volume keys when the route supports it.

Protected methods

void onCreate(Bundle savedInstanceState)

Inherited methods

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

Public constructors

MediaRouteControllerDialog

added in version 22.1.0
MediaRouteControllerDialog (Context context)

Parameters
context Context

MediaRouteControllerDialog

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

Parameters
context Context

theme int

Public methods

getMediaControlView

added in version 22.1.0
View getMediaControlView ()

Gets the media control view that was created by onCreateMediaControlView(Bundle).

Returns
View The media control view, or null if none.

getMediaSession

added in version 22.1.0
MediaSessionCompat.Token getMediaSession ()

Gets the session to use for metadata and transport controls.

Returns
MediaSessionCompat.Token The token for the session to use or null if none.

getRoute

added in version 22.1.0
MediaRouter.RouteInfo getRoute ()

Gets the route that this dialog is controlling.

Returns
MediaRouter.RouteInfo

isVolumeControlEnabled

added in version 24.1.0
boolean isVolumeControlEnabled ()

Returns whether to enable the volume slider and volume control using the volume keys when the route supports it.

Returns
boolean

onAttachedToWindow

void onAttachedToWindow ()

onCreateMediaControlView

added in version 22.1.0
View onCreateMediaControlView (Bundle savedInstanceState)

Provides the subclass an opportunity to create a view that will replace the default media controls for the currently playing content.

Parameters
savedInstanceState Bundle: The dialog's saved instance state.

Returns
View The media control view, or null if none.

onDetachedFromWindow

void onDetachedFromWindow ()

onKeyDown

boolean onKeyDown (int keyCode, 
                KeyEvent event)

Parameters
keyCode int

event KeyEvent

Returns
boolean

onKeyUp

boolean onKeyUp (int keyCode, 
                KeyEvent event)

Parameters
keyCode int

event KeyEvent

Returns
boolean

setVolumeControlEnabled

added in version 24.1.0
void setVolumeControlEnabled (boolean enable)

Sets whether to enable the volume slider and volume control using the volume keys when the route supports it.

The default value is true.

Parameters
enable boolean

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)