Most visited

Recently visited

MediaRouter.Callback

public static abstract class MediaRouter.Callback
extends Object

java.lang.Object
   ↳ android.support.v7.media.MediaRouter.Callback


用于接收有关媒体路由更改事件的接口。 该接口的所有方法都将从应用程序的主线程中调用。

回调只会收到相关的回调被注册,除非路线事件 CALLBACK_FLAG_UNFILTERED_EVENTS在指定标志 addCallback(MediaRouteSelector, Callback, int)

也可以看看:

Summary

Public constructors

MediaRouter.Callback()

Public methods

void onProviderAdded(MediaRouter router, MediaRouter.ProviderInfo provider)

在添加媒体路由提供程序时调用。

void onProviderChanged(MediaRouter router, MediaRouter.ProviderInfo provider)

当指定媒体路线提供者的属性发生变化时调用。

void onProviderRemoved(MediaRouter router, MediaRouter.ProviderInfo provider)

当媒体路由提供商被删除时调用。

void onRouteAdded(MediaRouter router, MediaRouter.RouteInfo route)

在添加媒体路由时调用。

void onRouteChanged(MediaRouter router, MediaRouter.RouteInfo route)

当指定媒体路线的属性发生变化时调用。

void onRoutePresentationDisplayChanged(MediaRouter router, MediaRouter.RouteInfo route)

当媒体路线的演示显示更改时调用。

void onRouteRemoved(MediaRouter router, MediaRouter.RouteInfo route)

当媒体路线已被删除时调用。

void onRouteSelected(MediaRouter router, MediaRouter.RouteInfo route)

当提供的媒体路由被选为活动路由时调用。

void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route)

当提供的媒体路由变为未选中作为活动路由时调用。

void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo route, int reason)

当提供的媒体路由变为未选中作为活动路由时调用。

void onRouteVolumeChanged(MediaRouter router, MediaRouter.RouteInfo route)

当媒体路线的音量变化时调用。

Inherited methods

From class java.lang.Object

Public constructors

MediaRouter.Callback

MediaRouter.Callback ()

Public methods

onProviderAdded

void onProviderAdded (MediaRouter router, 
                MediaRouter.ProviderInfo provider)

在添加媒体路由提供程序时调用。

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

onProviderChanged

void onProviderChanged (MediaRouter router, 
                MediaRouter.ProviderInfo provider)

当指定媒体路线提供者的属性发生变化时调用。

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

onProviderRemoved

void onProviderRemoved (MediaRouter router, 
                MediaRouter.ProviderInfo provider)

当媒体路由提供商被删除时调用。

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

onRouteAdded

void onRouteAdded (MediaRouter router, 
                MediaRouter.RouteInfo route)

在添加媒体路由时调用。

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

onRouteChanged

void onRouteChanged (MediaRouter router, 
                MediaRouter.RouteInfo route)

当指定媒体路线的属性发生变化时调用。

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

onRoutePresentationDisplayChanged

void onRoutePresentationDisplayChanged (MediaRouter router, 
                MediaRouter.RouteInfo route)

当媒体路线的演示显示更改时调用。

只要路由的演示文稿显示变得可用,被删除或对其某些属性(例如其大小)进行了更改,就会调用此方法。

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

也可以看看:

onRouteRemoved

void onRouteRemoved (MediaRouter router, 
                MediaRouter.RouteInfo route)

当媒体路线已被删除时调用。

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

onRouteSelected

void onRouteSelected (MediaRouter router, 
                MediaRouter.RouteInfo route)

当提供的媒体路由被选为活动路由时调用。

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

onRouteUnselected

void onRouteUnselected (MediaRouter router, 
                MediaRouter.RouteInfo route)

当提供的媒体路由变为未选中作为活动路由时调用。 详细原因, onRouteUnselected(MediaRouter, RouteInfo, int)改为onRouteUnselected(MediaRouter, RouteInfo, int)

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

onRouteUnselected

void onRouteUnselected (MediaRouter router, 
                MediaRouter.RouteInfo route, 
                int reason)

当提供的媒体路由变为未选中作为活动路由时调用。 默认实现调用onRouteUnselected(MediaRouter, MediaRouter.RouteInfo)

提供的原因将是以下之一:

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

void onRouteVolumeChanged (MediaRouter router, 
                MediaRouter.RouteInfo route)

当媒体路线的音量变化时调用。

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

Hooray!