Most visited

Recently visited

Added in API level 16

MediaRouter.Callback

public static abstract class MediaRouter.Callback
extends Object

java.lang.Object
   ↳ android.media.MediaRouter.Callback
Known Direct Subclasses


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

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

也可以看看:

Summary

Public constructors

MediaRouter.Callback()

Public methods

abstract void onRouteAdded(MediaRouter router, MediaRouter.RouteInfo info)

当添加指定类型的路由时调用。

abstract void onRouteChanged(MediaRouter router, MediaRouter.RouteInfo info)

当指示路线的某个方面发生变化时调用。

abstract void onRouteGrouped(MediaRouter router, MediaRouter.RouteInfo info, MediaRouter.RouteGroup group, int index)

当路由被添加到组时被调用。

void onRoutePresentationDisplayChanged(MediaRouter router, MediaRouter.RouteInfo info)

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

abstract void onRouteRemoved(MediaRouter router, MediaRouter.RouteInfo info)

当指定类型的路由被删除时调用。

abstract void onRouteSelected(MediaRouter router, int type, MediaRouter.RouteInfo info)

当提供的路线被选为给定路线类型的活动路线时调用。

abstract void onRouteUngrouped(MediaRouter router, MediaRouter.RouteInfo info, MediaRouter.RouteGroup group)

当路线从组中移除时调用。

abstract void onRouteUnselected(MediaRouter router, int type, MediaRouter.RouteInfo info)

当提供的路由变为未选中时,调用该路由作为给定路由类型的活动路由。

abstract void onRouteVolumeChanged(MediaRouter router, MediaRouter.RouteInfo info)

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

Inherited methods

From class java.lang.Object

Public constructors

MediaRouter.Callback

Added in API level 16
MediaRouter.Callback ()

Public methods

onRouteAdded

Added in API level 16
void onRouteAdded (MediaRouter router, 
                MediaRouter.RouteInfo info)

当添加指定类型的路由时调用。

Parameters
router MediaRouter: the MediaRouter reporting the event
info MediaRouter.RouteInfo: Route that has become available for use

onRouteChanged

Added in API level 16
void onRouteChanged (MediaRouter router, 
                MediaRouter.RouteInfo info)

当指示路线的某个方面发生变化时调用。

这并不表示此路线支持的类型已更改,只是名称或状态等整型信息已更新。

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

onRouteGrouped

Added in API level 16
void onRouteGrouped (MediaRouter router, 
                MediaRouter.RouteInfo info, 
                MediaRouter.RouteGroup group, 
                int index)

当路由被添加到组时被调用。

Parameters
router MediaRouter: the MediaRouter reporting the event
info MediaRouter.RouteInfo: The route that was added
group MediaRouter.RouteGroup: The group the route was added to
index int: The route index within group that info was added at

onRoutePresentationDisplayChanged

Added in API level 17
void onRoutePresentationDisplayChanged (MediaRouter router, 
                MediaRouter.RouteInfo info)

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

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

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

也可以看看:

onRouteRemoved

Added in API level 16
void onRouteRemoved (MediaRouter router, 
                MediaRouter.RouteInfo info)

当指定类型的路由被删除时调用。

Parameters
router MediaRouter: the MediaRouter reporting the event
info MediaRouter.RouteInfo: Route that has been removed from availability

onRouteSelected

Added in API level 16
void onRouteSelected (MediaRouter router, 
                int type, 
                MediaRouter.RouteInfo info)

当提供的路线被选为给定路线类型的活动路线时调用。

Parameters
router MediaRouter: the MediaRouter reporting the event
type int: Type flag set indicating the routes that have been selected
info MediaRouter.RouteInfo: Route that has been selected for the given route types

onRouteUngrouped

Added in API level 16
void onRouteUngrouped (MediaRouter router, 
                MediaRouter.RouteInfo info, 
                MediaRouter.RouteGroup group)

当路线从组中移除时调用。

Parameters
router MediaRouter: the MediaRouter reporting the event
info MediaRouter.RouteInfo: The route that was removed
group MediaRouter.RouteGroup: The group the route was removed from

onRouteUnselected

Added in API level 16
void onRouteUnselected (MediaRouter router, 
                int type, 
                MediaRouter.RouteInfo info)

当提供的路由变为未选中时,调用该路由作为给定路由类型的活动路由。

Parameters
router MediaRouter: the MediaRouter reporting the event
type int: Type flag set indicating the routes that have been unselected
info MediaRouter.RouteInfo: Route that has been unselected for the given route types

onRouteVolumeChanged

Added in API level 16
void onRouteVolumeChanged (MediaRouter router, 
                MediaRouter.RouteInfo info)

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

Parameters
router MediaRouter: the MediaRouter reporting the event
info MediaRouter.RouteInfo: The route with altered volume

Hooray!