get Alarm Ringtone Uri - Android android.app

Android examples for android.app:AlarmManager

Description

get Alarm Ringtone Uri

Demo Code

import android.media.RingtoneManager;
import android.net.Uri;

public class Main {

  public static Uri getAlarmRingtoneUri() {
    Uri alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
    if (alert == null) {
      alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
      if (alert == null) {
        alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
      }/*from  w w w . j a v  a  2s  . c o m*/
    }
    return alert;
  }

}

Related Tutorials