First create an instance of the AudioManager Class using which you can set the phone in Normal, Silent and Vibration Mode.

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

For setting the phone in Silent mode..

audio_mngr .setRingerMode(AudioManager.RINGER_MODE_SILENT);

For setting the phone in Normal mode..

audio_mngr .setRingerMode(AudioManager.RINGER_MODE_NORMAL);

For setting the phone in Vibrate mode..

audio_mngr .setRingerMode(AudioManager.RINGER_MODE_VIBRATE);


One Comment

  1. Syed December 9, 2014 at 8:18 am


    Is it possible to set the android phone to other user defined profiles?
    Eg: We have Outdoor, other customized profiles which user can add.


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.