I try to read out the Alarm volume the following way, but I always get wrong values. The ringer volume is always correct!! That happens on every Smartphone, HTC, Samsung, Sony and even on the virtual device. What could be the problem?
private AudioManager amanager;
@Override
public void onCreate(Bundle savedInstanceState)
{
amanager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
}
int volume = 3;
int alarm = 3;
try{
volume = amanager.getStreamVolume(amanager.getStreamVolume(AudioManager.STREAM_RING));
alarm = amanager.getStreamVolume(amanager.getStreamVolume(AudioManager.STREAM_ALARM));
Log.i("!!!!!!!!!!", "Activity!!, Volume ringer: " + volume + " Vol Alarm: " + alarm);
}catch(IllegalArgumentException e){}