I have this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
at the start of all activities in my application so when the user presses the volume up or down buttons, he controls the media volume.
I have a popup window in my program and when that appears the user can no longer control the volume.
Looking at similar questions it seems that setting up onKeyup/down
listeners can interfere with the process - but I have not set any up - the only listeners I have for the popup window are setOnClickListeners
for the buttons and a setOnDismissListener
for the window.
How can I fix this?
Looks like you have to call setOwnerActivity on the Dialog
object.
Documentation from the method:
Sets the Activity that owns this dialog. An example use: This Dialog will use the suggested volume control stream of the Activity.
While not tested, this should do the trick. There is also the possibility to use setVolumeControlStream.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With