Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

MediaRouteControllerDialog

open class MediaRouteControllerDialog : AlertDialog
kotlin.Any
   ↳ android.app.Dialog
   ↳ androidx.appcompat.app.AppCompatDialog
   ↳ androidx.appcompat.app.AlertDialog
   ↳ androidx.mediarouter.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.

Summary

Public constructors
<init>(context: Context!)

<init>(context: Context!, theme: Int)

Public methods
open Boolean
onKeyDown(keyCode: Int, event: KeyEvent!)

open Unit

open View!

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

open Unit

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

open View!
onCreateMediaControlView(savedInstanceState: Bundle!)

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

open MediaRouter.RouteInfo!

Gets the route that this dialog is controlling.

open MediaSessionCompat.Token!

Gets the session to use for metadata and transport controls.

open Unit

open Boolean

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

open Boolean
onKeyUp(keyCode: Int, event: KeyEvent!)

Protected methods
open Unit
onCreate(savedInstanceState: Bundle!)

Inherited functions

Public constructors

<init>

MediaRouteControllerDialog(context: Context!)

<init>

MediaRouteControllerDialog(context: Context!, theme: Int)

Public methods

onKeyDown

open fun onKeyDown(keyCode: Int, event: KeyEvent!): Boolean

onAttachedToWindow

open fun onAttachedToWindow(): Unit

getMediaControlView

open fun getMediaControlView(): View!

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

Return
View!: The media control view, or null if none.

setVolumeControlEnabled

open fun setVolumeControlEnabled(enable: Boolean): Unit

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

The default value is true.

onCreateMediaControlView

open fun onCreateMediaControlView(savedInstanceState: Bundle!): View!

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.
Return
View!: The media control view, or null if none.

getRoute

open fun getRoute(): MediaRouter.RouteInfo!

Gets the route that this dialog is controlling.

getMediaSession

open fun getMediaSession(): MediaSessionCompat.Token!

Gets the session to use for metadata and transport controls.

Return
MediaSessionCompat.Token!: The token for the session to use or null if none.

onDetachedFromWindow

open fun onDetachedFromWindow(): Unit

isVolumeControlEnabled

open fun isVolumeControlEnabled(): Boolean

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

onKeyUp

open fun onKeyUp(keyCode: Int, event: KeyEvent!): Boolean

Protected methods

onCreate

protected open fun onCreate(savedInstanceState: Bundle!): Unit