Change Phone Profile Mode in Android via Code

by Sasikumar 2013-11-13 08:46:33

To Change Phone-Profile Mode we can use the following code:
AudioManager myAudioManager;
myAudioManager= (AudioManager) getBaseContext().getSystemService(Context.AUDIO_SERVICE);

//To Change to Normal mode
myAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);

//To Change to Silent mode
myAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);

//To Change to Vibrate mode
myAudioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);

Laughing
Rolling eyes
780
like
0
dislike
0
mail
flag

You must LOGIN to add comments