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 {/* www. j a v  a2s.c  o m*/
            AudioManager manager = (AudioManager) context
                    .getSystemService(Context.AUDIO_SERVICE);
            max = manager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
        } catch (Exception e) {
        }
        return max;
    }
}

Related Tutorials