有没有一种方法来获取/设置媒体音量?我已经试过如下:
Is there a way to get/set media volume? I have tried the following:
AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
int currentVolume = audio.getStreamVolume(AudioManager.STREAM_RING);
但它返回铃声音量。
but it returns the ringtone volume.
而不是 AudioManager.STREAM_RING
你建议立即进行删除使用 AudioManager.STREAM_MUSIC
这个问题已经讨论过here.
Instead of AudioManager.STREAM_RING
you shoul use AudioManager.STREAM_MUSIC
This question has already discussed here.