turn Audio volume Up Most - Android Media

Android examples for Media:Media Volume

Description

turn Audio volume Up Most

Demo Code


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

public class Main{
    /*  w  w w .  ja va  2  s  . c  om*/
    public static void turnUpMost(Context context) {

        AudioManager audioMgr = (AudioManager) context
                .getSystemService(Context.AUDIO_SERVICE);
        audioMgr.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
        audioMgr.setStreamVolume(AudioManager.STREAM_RING,
                audioMgr.getStreamMaxVolume(AudioManager.STREAM_RING), 0);
        audioMgr.setStreamVolume(AudioManager.STREAM_NOTIFICATION, audioMgr
                .getStreamMaxVolume(AudioManager.STREAM_NOTIFICATION), 0);
        audioMgr.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
                AudioManager.VIBRATE_SETTING_ON);
    }
}

Related Tutorials