How can I make as long as the app is opened, the users shouldn't be allowed to change the volume of the device?, if this is possible.
I have found that you can set the volume to mute with AudioManger:
AudioManager volumeControl = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
volumeControl.setStreamMute(AudioManager.STREAM_MUSIC, true);
However this is not what I'm looking for. I want when the user enters the application to lock its current volume and does not allow to change it, while in background a melody is playing increasing the volume. (this is the reasons for why I don't want let user control the volume)
I was thinking if there's a possibility to override the Volume up, Volume down keys? just like we can override the Back button.