Buda Gavril Buda Gavril - 1 year ago 44
Android Question

How do you get/set media volume (not ringtone volume) in Android?

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.

Answer Source

Instead of AudioManager.STREAM_RING you shoul use AudioManager.STREAM_MUSIC This question has already discussed here.