O Google tem o compromisso de promover a igualdade racial para as comunidades negras. Saiba como.

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 requestedRoute: MediaRouter.RouteInfo, @NonNull selectedRoute: MediaRouter.RouteInfo, reason: Int)

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 MediaRouter#addCallback(MediaRouteSelector, Callback, int).

Public methods

onProviderAdded

open fun onProviderAdded(
    router: MediaRouter!,
    provider: MediaRouter.ProviderInfo!
): Unit

Called when a media route provider has been added.

Parameters
router MediaRouter!: The media router reporting the event.
provider MediaRouter.ProviderInfo!: The provider that has become available for use.

onProviderChanged

open fun onProviderChanged(
    router: MediaRouter!,
    provider: MediaRouter.ProviderInfo!
): Unit

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

Parameters
router MediaRouter!: The media router reporting the event.
provider MediaRouter.ProviderInfo!: The provider that was changed.

onProviderRemoved

open fun onProviderRemoved(
    router: MediaRouter!,
    provider: MediaRouter.ProviderInfo!
): Unit

Called when a media route provider has been removed.

Parameters
router MediaRouter!: The media router reporting the event.
provider MediaRouter.ProviderInfo!: The provider that has been removed from availability.

onRouteAdded

open fun onRouteAdded(
    router: MediaRouter!,
    route: MediaRouter.RouteInfo!
): Unit

Called when a media route has been added.

Parameters
router MediaRouter!: The media router reporting the event.
route MediaRouter.RouteInfo!: The route that has become available for use.

onRouteChanged

open fun onRouteChanged(
    router: MediaRouter!,
    route: MediaRouter.RouteInfo!
): Unit

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

Parameters
router MediaRouter!: The media router reporting the event.
route MediaRouter.RouteInfo!: The route that was changed.

onRoutePresentationDisplayChanged

open fun onRoutePresentationDisplayChanged(
    router: MediaRouter!,
    route: MediaRouter.RouteInfo!
): Unit

Called when a media route's presentation display changes.

This method is called whenever the route's presentation display becomes available, is removed or has changes to some of its properties (such as its size).

Parameters
router MediaRouter!: The media router reporting the event.
route MediaRouter.RouteInfo!: The route whose presentation display changed.

onRouteRemoved

open fun onRouteRemoved(
    router: MediaRouter!,
    route: MediaRouter.RouteInfo!
): Unit

Called when a media route has been removed.

Parameters
router MediaRouter!: The media router reporting the event.
route MediaRouter.RouteInfo!: The route that has been removed from availability.

onRouteSelected

open fun onRouteSelected(
    router: MediaRouter!,
    route: MediaRouter.RouteInfo!
): Unit

Deprecated: Use onRouteSelected(MediaRouter, RouteInfo, int) instead.

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

Parameters
router MediaRouter!: The media router reporting the event.
route MediaRouter.RouteInfo!: The route that has been selected.

onRouteSelected

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

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

The reason provided will be one of the following:

Parameters
router MediaRouter: The media router reporting the event.
route MediaRouter.RouteInfo: The route that has been selected.
reason Int: The reason for unselecting the previous route.

onRouteSelected

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

Called when the supplied media route becomes selected as the active route, which may be different from the route requested by selectRoute(RouteInfo). That can happen when media transfer feature is enabled. The default implementation calls onRouteSelected(MediaRouter, RouteInfo, int) with the actually selected route.

Parameters
router MediaRouter: The media router reporting the event.
requestedRoute MediaRouter.RouteInfo: The route that was requested to be selected.
selectedRoute MediaRouter.RouteInfo: The route that has been selected.
reason Int: The reason for unselecting the previous route.

onRouteUnselected

open fun onRouteUnselected(
    router: MediaRouter!,
    route: MediaRouter.RouteInfo!
): Unit

Deprecated: Use onRouteUnselected(MediaRouter, RouteInfo, int) instead.

Called when the supplied media route becomes unselected as the active route. For detailed reason, override onRouteUnselected(MediaRouter, RouteInfo, int) instead.

Parameters
router MediaRouter!: The media router reporting the event.
route MediaRouter.RouteInfo!: The route that has been unselected.

onRouteUnselected

open fun onRouteUnselected(
    router: MediaRouter!,
    route: MediaRouter.RouteInfo!,
    reason: Int
): Unit

Called when the supplied media route becomes unselected as the active route. The default implementation calls #onRouteUnselected.

The reason provided will be one of the following:

Parameters
router MediaRouter!: The media router reporting the event.
route MediaRouter.RouteInfo!: The route that has been unselected.
reason Int: The reason for unselecting the route.

onRouteVolumeChanged

open fun onRouteVolumeChanged(
    router: MediaRouter!,
    route: MediaRouter.RouteInfo!
): Unit

Called when a media route's volume changes.

Parameters
router MediaRouter!: The media router reporting the event.
route MediaRouter.RouteInfo!: The route whose volume changed.