set Notification Sound Volume Max - Android Media

Android examples for Media:Media Volume

Description

set Notification Sound Volume Max

Demo Code


//package com.java2s;
import android.content.Context;
import android.media.AudioManager;

public class Main {
    public static void setNotificationSoundMax(Context mContext) {
        AudioManager am = (AudioManager) mContext
                .getSystemService(Context.AUDIO_SERVICE);
        int max = am.getStreamMaxVolume(AudioManager.STREAM_NOTIFICATION);
        am.setStreamVolume(AudioManager.STREAM_NOTIFICATION, max,
                AudioManager.FLAG_VIBRATE);
    }/*w ww . j av a 2s. co m*/
}

Related Tutorials