get Phone Media Volume - Android Phone

Android examples for Phone:Volume

Description

get Phone Media Volume

Demo Code


//package com.java2s;

import android.content.Context;

import android.provider.Settings;

public class Main {

    public static int getMediaVolume(Context context) {
        return Settings.System.getInt(context.getContentResolver(),
                "volume_music", 0);
        //            Settings.System.VOLUME_MUSIC, 0);
    }//  ww  w  . j ava2 s . c  o  m
}

Related Tutorials