Forcing volume control to be for the Media volume in my app

by John Lussmyer » Tue, 28 Dec 2010 01:44:18 GMT


Sponsored Links
 My app plays very short sounds frequently.
I'd like the user to be able to use their normal volume controls to turn the
volume up or down.
The problem is that while my app is running, the volume control defaults to
the Ringer volume, and only adjusts the Media volume if the user happens to
press the button while one of my beeps or clicks is playing.
How can I tell Android that while my app is active, the volume controls
should default to adjusting the Media volume?

-- 



Re: Forcing volume control to be for the Media volume in my app

by Mark Murphy » Tue, 28 Dec 2010 01:49:34 GMT


 


In the affected activity, call setVolumeControlStream().

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 


Sponsored Links


Re: Forcing volume control to be for the Media volume in my app

by John Lussmyer » Tue, 28 Dec 2010 02:11:25 GMT


 Thanks.  Using:
        setVolumeControlStream(AudioManager.STREAM_MUSIC);
did the trick.
(Sure would be nice if the setVolumeControlStream() docs actually told you
what the valid values are, or at least where to find them.)





-- 



Other Threads

1. RTTI

Does bionic's C++ library support RTTI (eg. for dynamic_cast)?  I did
not see anything in the CAVEATS file about RTTI.  Then again, I didn't
see anything about the lack of STL support either, but found out the
hard way.  Thanks!
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: 

2. API for arbitrary tags in an image file (location etc)?

I noticed that Picassa can read location from tags in an image file.  The
camera in the G1 can update a tag for location.  Is this available in  an
API
so that we can do the same in our apps?

Thx

--~--~---------~--~----~------------~-------~--~----~

3. API for getting URL associated with a Geopoint

4. Filesystem on G1

5. Adding views at runtime.

6. Tips for Orientation

7. maps package sources