Is there a way to get/set media volume? I have tried the following:
AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
int currentV
To set volume to 0
AudioManager audioManager;
audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);
To set volume to full
AudioManager audioManager;
audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 20, 0);
the volume can be adjusted by changing the index value between 0 and 20