Most visited

Recently visited

Added in API level 16

MediaRouter.VolumeCallback

public static abstract class MediaRouter.VolumeCallback
extends Object

java.lang.Object
   ↳ android.media.MediaRouter.VolumeCallback


接收有关音量变化的事件的界面。 该接口的所有方法都将从应用程序的主线程中调用。

一个VolumeCallback将只接收与注册回调的路由相关的事件。

也可以看看:

Summary

Public constructors

MediaRouter.VolumeCallback()

Public methods

abstract void onVolumeSetRequest(MediaRouter.RouteInfo info, int volume)

当路线的音量应设置为给定值时调用

abstract void onVolumeUpdateRequest(MediaRouter.RouteInfo info, int direction)

当路线的体积应增加或减少时调用。

Inherited methods

From class java.lang.Object

Public constructors

MediaRouter.VolumeCallback

Added in API level 16
MediaRouter.VolumeCallback ()

Public methods

onVolumeSetRequest

Added in API level 16
void onVolumeSetRequest (MediaRouter.RouteInfo info, 
                int volume)

当路线的音量应设置为给定值时调用

Parameters
info MediaRouter.RouteInfo: the route affected by this event
volume int: an integer indicating the new volume value that should be used, always between 0 and the value set by setVolumeMax(int).

onVolumeUpdateRequest

Added in API level 16
void onVolumeUpdateRequest (MediaRouter.RouteInfo info, 
                int direction)

当路线的体积应增加或减少时调用。

Parameters
info MediaRouter.RouteInfo: the route affected by this event
direction int: an integer indicating whether the volume is to be increased (positive value) or decreased (negative value). For bundled changes, the absolute value indicates the number of changes in the same direction, e.g. +3 corresponds to three "volume up" changes.

Hooray!