MediaRouter2.RouteCallback


public static abstract class MediaRouter2.RouteCallback
extends Object

java.lang.Object
   ↳ android.media.MediaRouter2.RouteCallback


Callback for receiving events about media route discovery.

Summary

Public constructors

RouteCallback()

Public methods

void onRoutesAdded(List<MediaRoute2Info> routes)

This method was deprecated in API level 34. Use onRoutesUpdated(java.util.List) instead.

void onRoutesChanged(List<MediaRoute2Info> routes)

This method was deprecated in API level 34. Use onRoutesUpdated(java.util.List) instead.

void onRoutesRemoved(List<MediaRoute2Info> routes)

This method was deprecated in API level 34. Use onRoutesUpdated(java.util.List) instead.

void onRoutesUpdated(List<MediaRoute2Info> routes)

Called when the route list is updated, which can happen when routes are added, removed, or modified.

Inherited methods

Public constructors

RouteCallback

public RouteCallback ()

Public methods

onRoutesAdded

Added in API level 30
Deprecated in API level 34
public void onRoutesAdded (List<MediaRoute2Info> routes)

This method was deprecated in API level 34.
Use onRoutesUpdated(java.util.List) instead.

Called when routes are added. Whenever you register a callback, this will be invoked with known routes.

Parameters
routes List: the list of routes that have been added. It's never empty. This value cannot be null.

onRoutesChanged

Added in API level 30
Deprecated in API level 34
public void onRoutesChanged (List<MediaRoute2Info> routes)

This method was deprecated in API level 34.
Use onRoutesUpdated(java.util.List) instead.

Called when the properties of one or more existing routes are changed. For example, it is called when a route's name or volume have changed.

Parameters
routes List: the list of routes that have been changed. It's never empty. This value cannot be null.

onRoutesRemoved

Added in API level 30
Deprecated in API level 34
public void onRoutesRemoved (List<MediaRoute2Info> routes)

This method was deprecated in API level 34.
Use onRoutesUpdated(java.util.List) instead.

Called when routes are removed.

Parameters
routes List: the list of routes that have been removed. It's never empty. This value cannot be null.

onRoutesUpdated

Added in API level 34
public void onRoutesUpdated (List<MediaRoute2Info> routes)

Called when the route list is updated, which can happen when routes are added, removed, or modified. It will also be called when a route callback is registered.

Parameters
routes List: the updated list of routes filtered by the callback's individual discovery preferences. This value cannot be null.