get Ringtone Sound - Android Phone

Android examples for Phone:Sound

Description

get Ringtone Sound

Demo Code


//package com.java2s;

import android.content.Context;

import android.media.AudioManager;

public class Main {

    public static int getRingtoneSound(Context context) {
        int current = 0;
        try {/*from  w w  w . j a v a 2s.c  o m*/
            AudioManager manager = (AudioManager) context
                    .getSystemService(Context.AUDIO_SERVICE);
            current = manager.getStreamVolume(AudioManager.STREAM_RING);
        } catch (Exception e) {
        }
        return current;
    }
}

Related Tutorials