turn Down audio volume - Android Media

Android examples for Media:Media Volume

Description

turn Down audio volume

Demo Code


import android.content.Context;
import android.media.AudioManager;

public class Main {

  public static void turnDown(Context context) {
    AudioManager audioMgr = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    audioMgr.setRingerMode(AudioManager.RINGER_MODE_SILENT);
    audioMgr.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
  }//from  w  w w  .ja va  2  s  .  c  om
}

Related Tutorials