How to set the mediaplayer volume programmatically. I use it for alarm notification. Any help is highly appreciated and thanks in advance.
Try This
protected static void setVolume(int volume) { currentVolume = volume; { if (volume == 1) { volume = 2; } try { float vol = ((float) volume / CONSTANT.SYSTEM_MAX_VOLUME); mediaPlayer.setVolume(vol, vol); } catch (Exception e) { e.printStackTrace(); } } }