Friday, 19 August 2011

Change the Ringer Mode

Today i am going to write about changing the ringer mode of the Android phone programmitically.
Quite Simple: :-)

Step1):Make an object of Audio Manger class
                    AudioManager am;
                    am = (AudioManager)
                    context.getSystemService(Context.AUDIO_SERVICE);



Step2)Now after you have created the object of audio manager class you can at any time change the Ringer mode as follows:

For Silent Mode:
am.setRingerMode(0);        


For Vibrate mode:

am.setRingerMode(1);        


For Normal mode:

am.setRingerMode(2);       


:-)

1 comment:

  1. Lovely post karan , u made my day !!!!! Thanks a Lot and keep it up !!!! :):-)

    ReplyDelete