Android 12 Developer Preview is here! Try it out, and give us your feedback!

Callback

abstract class Callback
kotlin.Any
   ↳ androidx.mediarouter.media.MediaRouter.Callback

Interface for receiving events about media routing changes. All methods of this interface will be called from the application's main thread.

A Callback will only receive events relevant to routes that the callback was registered for unless the MediaRouter#CALLBACK_FLAG_UNFILTERED_EVENTS flag was specified in MediaRouter#addCallback(MediaRouteSelector, Callback, int).

Summary

Public constructors

Interface for receiving events about media routing changes.

Public methods
open Unit

Called when a media route provider has been added.

open Unit

Called when a property of the indicated media route provider has changed.

open Unit

Called when a media route provider has been removed.

open Unit

Called when a media route has been added.

open Unit

Called when a property of the indicated media route has changed.

open Unit

Called when a media route's presentation display changes.

open Unit

Called when a media route has been removed.

open Unit

Called when the supplied media route becomes selected as the active route.

open Unit
onRouteSelected(@NonNull router: MediaRouter, @NonNull route: MediaRouter.RouteInfo, reason: Int)

Called when the supplied media route becomes selected as the active route.

open Unit
onRouteSelected(@NonNull router: MediaRouter, @NonNull selectedRoute: MediaRouter.RouteInfo, reason: Int, @NonNull requestedRoute: MediaRouter.RouteInfo)

Called when the supplied media route becomes selected as the active route, which may be different from the route requested by selectRoute(RouteInfo).

open Unit

Called when the supplied media route becomes unselected as the active route.

open Unit

Called when the supplied media route becomes unselected as the active route.

open Unit

Called when a media route's volume changes.

Public constructors

<init>

Callback()

Interface for receiving events about media routing changes. All methods of this interface will be called from the application's main thread.

A Callback will only receive events relevant to routes that the callback was registered for unless the MediaRouter#CALLBACK_FLAG_UNFILTERED_EVENTS flag was specified in M