Search code examples
javaandroidvolume

Changing the volume of the application (not the device)


I am making a code to change the volume through a seekbar, and I used this Code as a reference. However this way the volume of the whole device is changed, I need to change only the volume of the application. Is it possible to do that?

Thank you.


Solution

  • No, it is not possible to change your app only volume, you can only change the system volume. What you should do is when the seekbar value changes, save the volume in shared preferences and then when playing a sound, fetch that volume and use it in the media player.