Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    /** Returns the volume for notifications. */
    public static int getNotificationVolume(Context context) {
        AudioManager am = getAudioManager(context);
        return am.getStreamVolume(AudioManager.STREAM_NOTIFICATION);
    }

    private static AudioManager getAudioManager(Context context) {
        return (AudioManager) context.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
    }
}