0

我正在使用此代码播放声音。

我想让用户能够改变声音的音量。你能告诉我怎么做吗?

NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification();
notification.sound = Uri.parse("android.resource://emad/raw/quarter");

谢谢。

真的,埃马德

4

1 回答 1

2

利用

  notification.audioStreamType = AudioManager.STREAM_MUSIC;

  context.setVolumeControlStream(AudioManager.STREAM_MUSIC);
于 2011-09-07T16:48:42.087 回答