This has happened to me a number of times and this has probably happened to you as well. On IOS, there is a setting "change with buttons" setting that you can turn off to disable this feature. For Android devices, however, this option is almost non-existint. The good thing is that there is an easy way to disable volume change via the volume rocker buttons on an Android device via a free app "Rocker Locker".
To get this app, simply:
- Open the Play store and do a search for "Rocker Locker".
- Download and install the application.
- Once installed, simply open the application and tap on the ENABLE button in the middle of the screen.
