Android examples for Android OS:Notification
Return the volume for notifications.
//package com.java2s; import android.content.Context; import android.media.AudioManager; import android.support.annotation.NonNull; public class Main { /** Return the volume for notifications. */ public static int getNotificationVolume(@NonNull Context context) { return getAudioManager(context).getStreamVolume( AudioManager.STREAM_NOTIFICATION); }/*from ww w .java2 s . c om*/ private static AudioManager getAudioManager(@NonNull Context context) { return (AudioManager) context.getApplicationContext() .getSystemService(Context.AUDIO_SERVICE); } }