Buda Gavril Buda Gavril - 3 months ago 7
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

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

Comments