whiteberryapps whiteberryapps - 2 months ago 8
Android Question

Is it possible to turn off the silent mode programmatically in android?

Is it possible to turn off the silent mode programmatically in Android?

Answer

Solution for you .

AudioManager am;
am= (AudioManager) getBaseContext().getSystemService(Context.AUDIO_SERVICE);

//For Normal mode
am.setRingerMode(AudioManager.RINGER_MODE_NORMAL);

//For Silent mode
am.setRingerMode(AudioManager.RINGER_MODE_SILENT);

//For Vibrate mode
am.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);