I would like to have the volume rocker affect media volume when app is in foreground. How would I do that?
Per the volume controls documentation:
To ensure that volume controls adjust the correct stream, you should call
setVolumeControlStream()
passing inAudioManager.STREAM_MUSIC
.
setVolumeControlStream(AudioManager.STREAM_MUSIC);