get Current Ring Volume - Android android.provider

Android examples for android.provider:Settings

Description

get Current Ring Volume

Demo Code

import android.content.Context;
import android.media.AudioManager;

public class Main {

  public static int getCurrentRingVolume(Context ctx) {
    AudioManager audioManager = (AudioManager) ctx.getSystemService(Context.AUDIO_SERVICE);
    return audioManager.getStreamVolume(AudioManager.STREAM_RING);
  }/*from ww w .j  a  va  2  s  .  co  m*/

}

Related Tutorials