get Music Max Sound - Android Phone

Android examples for Phone:Sound

Description

get Music Max Sound

Demo Code


//package com.java2s;

import android.content.Context;

import android.media.AudioManager;

public class Main {

    public static int getMusicMaxSound(Context context) {
        int max = 0;
        try {/*from  w w w  . ja  v  a 2  s  .  co m*/
            AudioManager manager = (AudioManager) context
                    .getSystemService(Context.AUDIO_SERVICE);
            max = manager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
        } catch (Exception e) {
        }
        return max;
    }
}

Related Tutorials