I created the music player app and i want to set the volume
up/down programmatically .
I want to implement two another
Try below code
audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
seekbar.setMax(audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC));
seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int newVolume, boolean b) {
textview.setText("Media Volume : " + newVolume);
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, newVolume, 0);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {}
});