I use setStreamMute(int, boolean)
method from the AudioManager
class on Android 4.0.3. Every time I call this method a toast with the current volume appears in the UI. Is there a way to hide that volume toast when muting/unmuting?
Asked
Active
Viewed 740 times
0

Praful Bhatnagar
- 7,425
- 2
- 36
- 44

ideskov
- 23
- 2
1 Answers
0
You can use setStreamVolume
to set the volume to the lowest. What this gives you a method to andjust the volume, but also a flag (see HERE). The last int
argument is the FLAG_SHOW_UI, which is the flag for those messages.
Cheers

g00dy
- 6,752
- 2
- 30
- 43
-
Thank you for your answer. I'm familiar with this option but I need to use the 'setStreamMute' method in this particular case. – ideskov Feb 27 '13 at 08:46
-
As far as I see, I couldn't find anything regarding that matter. Just out of curiosity - why is it mandatory to use the `setStreamMute` ? – g00dy Feb 27 '13 at 09:02
-
I couldn't find anything too. It's a matter of native implementation I guess. To satisfy your curiosity: my app has its own volume buttons, mute button and volume bar as well. I find it a better user experience if you mute the sound and you are still able to change the volume plus seeing that change in the volume bar of the app. However, your answer is the only way out of the situation for now :) – ideskov Feb 27 '13 at 10:21