Volume control with android hardware buttons

218 views
Skip to first unread message

Horst

unread,
Jan 30, 2011, 10:46:03 AM1/30/11
to phonegap
Hello,

normal in an android app the hardware volume up/down buttons changes
the media volume. In my phonegap app i change the ringtone volume.
How can i make it, that in my app the button also changes the media
volume?

best regards
Horst

Simon MacDonald

unread,
Jan 30, 2011, 8:52:52 PM1/30/11
to phon...@googlegroups.com
I do believe you have found a bug. Can you open a ticket for us in
the tracking system:

http://phonegap.lighthouseapp.com/projects/20118-android/overview

Simon Mac Donald
http://hi.im/simonmacdonald

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>

Simon MacDonald

unread,
Feb 2, 2011, 10:37:36 AM2/2/11
to phon...@googlegroups.com
Hey Horst,

I just checked in a fix for this issue for the 0.9.4 release. In the
meantime if you want to fix this issue in your app you can add the
following line:

setVolumeControlStream(AudioManager.STREAM_MUSIC);

into the onCreate() method of your main Android class that extends DroidGap.

Ash Connell

unread,
Dec 29, 2014, 12:39:53 AM12/29/14
to phon...@googlegroups.com
Simon,

This bug still seems to exist, atleast on 5.0 Lollipop. I cant find anything online so i was wondering if you were aware of anything?

Ash Connell

unread,
Dec 29, 2014, 12:42:41 AM12/29/14
to phon...@googlegroups.com
In fact, commenting out the line:

setVolumeControlStream(AudioManager.STREAM_MUSIC);

from the latest CordovaActivity.java init method, fixes this for me.

STREAM_MUSIC is not the standard ringer volume, and I dont think it should be here...


On Thursday, February 3, 2011 2:37:36 AM UTC+11, Simon wrote:
Reply all
Reply to author
Forward
0 new messages