While i am developing one application i was stuck how to the volume of an Android application to maximum, and I saw no of post regarding this issue MediaPlayer.setValue function.
MediaPlayer.setValue( )
It's not the right function for setting the volume (see the help).
To set the volume to maximum i used below code it's working.
// Get the AudioManager
AudioManager audioManager =
(AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
// Set the volume of played media to maximum.
audioManager.setStreamVolume (
AudioManager.STREAM_MUSIC,
audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC),
0);
Tags:volume increase in android,android volume,android mediaplayer volume increase,how to set maximum volume,android AudioManager volume setting,how to set max volume
MediaPlayer.setValue( )
It's not the right function for setting the volume (see the help).
To set the volume to maximum i used below code it's working.
// Get the AudioManager
AudioManager audioManager =
(AudioManager)this.getSystemService(Context.AUDIO_SERVICE);
// Set the volume of played media to maximum.
audioManager.setStreamVolume (
AudioManager.STREAM_MUSIC,
audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC),
0);
Tags:volume increase in android,android volume,android mediaplayer volume increase,how to set maximum volume,android AudioManager volume setting,how to set max volume
working Awesome
ReplyDelete