I would like to know how can I force volume buttons to only control media while in my application.
I know this is an android specific question and ios does this by default.
There are two related questions giving android solutions:
Volume Control in android application
How can I manage audio volumes sanely in my Android app?
They both suggest adding setVolumeControlStream(AudioManager.STREAM_MUSIC);
to android but I'm a react-native
developer and not familiar with java
.
There is also this react-native related question:
Which gives me no idea on where onCreate()
is.
Any Specific suggestions on where to add this line in java part of react-native?