Reputation: 16490
I am building an audio player, where the audio can be turned on and off. When the audio is on the volume control button on the phone properly controls the media volume.
However when the audio is off, the volume button controls the phone ringer volume.
Is it possible to configure the volume button such that it will control the media volume even when media is not playing?
Upvotes: 5
Views: 778
Reputation: 6709
In your activity's onCreate() you can do:
setVolumeControlStream(AudioManager.STREAM_MUSIC);
like described in How to control media volume?
Upvotes: 5