Language

MediaRouter2.ShowSystemOutputSwitcher Method

Definition

Overloads

Name Description
ShowSystemOutputSwitcher()

Shows the system output switcher dialog.

ShowSystemOutputSwitcher(MediaSession+Token)

Shows the system output switcher dialog for a specific MediaSession.

ShowSystemOutputSwitcher()

Shows the system output switcher dialog.

[Android.Runtime.Register("showSystemOutputSwitcher", "()Z", "", ApiSince=34)]
public bool ShowSystemOutputSwitcher();
[<Android.Runtime.Register("showSystemOutputSwitcher", "()Z", "", ApiSince=34)>]
member this.ShowSystemOutputSwitcher : unit -> bool

Returns

true if the output switcher dialog is being shown, or false if the call is ignored because the app is in the background.

Attributes

Remarks

Shows the system output switcher dialog.

Should only be called when the context of MediaRouter2 is in the foreground and visible on the screen.

The appearance and precise behaviour of the system output switcher dialog may vary across different devices, OS versions, and form factors, but the basic functionality stays the same.

See Output Switcher documentation for more details.

Java documentation for android.media.MediaRouter2.showSystemOutputSwitcher().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ShowSystemOutputSwitcher(MediaSession+Token)

Shows the system output switcher dialog for a specific MediaSession.

[Android.Runtime.Register("showSystemOutputSwitcher", "(Landroid/media/session/MediaSession$Token;)Z", "", ApiSince=36)]
public bool ShowSystemOutputSwitcher(Android.Media.Session.MediaSession.Token sessionToken);
[<Android.Runtime.Register("showSystemOutputSwitcher", "(Landroid/media/session/MediaSession$Token;)Z", "", ApiSince=36)>]
member this.ShowSystemOutputSwitcher : Android.Media.Session.MediaSession.Token -> bool

Parameters

sessionToken
MediaSession.Token

Returns

true if the output switcher dialog is being shown, or false if the call is ignored because the app is in the background.

Attributes

Remarks

Shows the system output switcher dialog for a specific MediaSession. The MediaSession.Token argument allows the system to identify which routing session to display as active. This is done via MediaSession.setPlaybackToRemote and VolumeProvider.getVolumeControlId when playing remotely, and MediaSession.setPlaybackToLocal when playing on this device. This method is preferred over showSystemOutputSwitcher() to prevent the system from making wrong inferences about where playback is happening.

Android reference for android.media.MediaRouter2.showSystemOutputSwitcher.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to