In my application I have overridden the onKeyDown()
and onKeyUp()
functions in order to capture volume keys events. I use such events in order to control my application volume. I use the music stream to play my sounds. When detecting an event like this I also show a custom toast (similar to the one shown by Android). The problems I'm facing with this take are:
- Android always plays a sound on volume keys events
- That sound is played always at the same intensity.
What I'd like is to control the intensity at which the default sound is played (also the stream on which is played) in the following way: a louder sound for a higher volume and a lower sound for a low volume, if this is possible. Or a way to disable playing that default sound and play my custom sound at the intensity I just set.