Thursday, June 21, 2012

Change Loud & Silent Mode Programmatically In Android

Here i have explained about changing Loud mode to Silent mode and Silent mode to Loud mode programmatically in android.ProfileChanger

public class ProfileChangerActivity extends Activity {
/** Called when the activity is first created. */

ToggleButton tbt;
TextView txtview;

public void onCreate(Bundle savedInstanceState) {

tbt = (ToggleButton) findViewById(;
txtview = (TextView) findViewById(;
txtview.setText("Welcome to Profile Changer Application");
final AudioManager mobilemode = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);

tbt.setOnClickListener(new OnClickListener() {

public void onClick(View v) {
// TODO Auto-generated method stub

if(tbt.getText().toString().equals("Switch to LOUD"))
txtview.setText("SILENT profile activated !");
Toast.makeText(getBaseContext(),"SILENT profile activated ",Toast.LENGTH_LONG).show();
else if(tbt.getText().toString().equals("Switch to SILENT"))
txtview.setText("LOUD profile activated !");
Toast.makeText(getBaseContext(),"LOUD profile activated !",Toast.LENGTH_LONG).show();



Here is your output.

You can download the source here
Arun Kumar Munusamy Web Developer

Morbi aliquam fringilla nisl. Pellentesque eleifend condimentum tellus, vel vulputate tortor malesuada sit amet. Aliquam vel vestibulum metus. Aenean ut mi aucto.


  1. Earn from Ur Website or Blog thr!


    Nice to e-meet you. A very warm greetings from PayOffers Publisher Team.

    I am Sanaya Publisher Development Manager @ PayOffers Publisher Team.

    I would like to introduce you and invite you to our platform, which is one of the fastest growing Indian Publisher Network.

    If you're looking for an excellent way to convert your Website / Blog visitors into revenue-generating customers, join the Publisher Network today!

    Why to join in Indian Publisher Network?

    * Highest payout Indian Lead, Sale, CPA, CPS, CPI Offers.
    * Only Publisher Network pays Weekly to Publishers.
    * Weekly payments trough Direct Bank Deposit, & Checks.
    * Referral payouts.
    * Best chance to make extra money from your website.

    Join and earn extra money from your Website / Blog

    If you have any questions in your mind please let us know and you can connect us on the mentioned email ID

    I’m looking forward to helping you generate record-breaking profits!

    Thanks for your time, hope to hear from you soon,
    The team at

  2. Is is possible to switch to outdoor and other customized user profiles?

  3. Thanks for sharing useful information we are provide best service.

    Videocon has come with a wide range of Value Added Services including Caller Tunes, Sports, VRashi(Horoscope), News and Entertainment. A lot of new exciting services are going to be in the list to rock!Videocon has also started GPRS services, which is free for couple of days .

  4. I was creating an app that would toggle the phones silent mode depending on the time at which the phone would be in. For example, if the phone's time service shows that it is in the time which will set by the user then it would automatically go silent. My question is how to get the phone to go to silent and then turn on to the original volume automatically