I'm building an Android app, and I'm trying to disable all sounds and vibration of the device when the app starts.
I'm a newbie so I cannot find how to do that.
Any idea?
Thanks in advance.
Thanks! :) I reply myself to complete the answer:
AudioManager aManager=(AudioManager)getSystemService(AUDIO_SERVICE);
aManager.setRingerMode(aManager.RINGER_MODE_SILENT);
Check this here and take a look at public void setRingerMode (int ringerMode)
with the RINGER_MODE_SILENT
option.
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