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

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

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.