音效

在 API 级别 XE12 中引入

Glass 专用音效的额外常量。

该集使用 Google Glass 专用的声音扩展现有的 AudioManager 常量。

常规用法

如需播放声音,请使用所需声音调用 playSoundEffect(int)。例如,如需播放 TAP 声音,请使用以下代码:

 AudioManager audio = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
 audio.playSoundEffect(Sounds.TAP);
 

常量
int 禁止 用户尝试了一项不允许的操作。
int 已拒绝 用户关闭了 1 项内容。
int ERROR 出错了。
int 已选择 已选择某项内容。
int 成功 操作成功完成。
int TAP 用户点按了内容。
继承的方法

常量

在 API 级别 XE12 中引入

public static final int DISALLOWED

用户尝试了一项不允许的操作。

另请参阅
常量值: 10
在 API 级别 XE12 中引入

public static final int DISMISSED

用户关闭了 1 项内容。

另请参阅
常量值: 15
在 API 级别 XE12 中引入

public static final int ERROR

出错了。

另请参阅
常量值: 11
在 API 级别 XE12 中引入

public static final int SELECTED

已选择某项内容。

另请参阅
常量值: 14
在 API 级别 XE12 中引入

public static final int SUCCESS

操作成功完成。

另请参阅
常量值: 12
在 API 级别 XE12 中引入

public static final int TAP

用户点按了内容。

另请参阅
常量值: 13