String getRingtoneTitle(String ringtoneUriString) { String defaultRingtoneTitle = "No Ringtone"; Uri ringtoneUri = null; try { ringtoneUri = Uri.parse(ringtoneUriString); } catch (Exception ignored) { Logcat.w(ignored, "Settings parse notification ringtone uri fail." + "ringtoneUriString = ", ringtoneUriString); } if (ringtoneUriString.isEmpty() || ringtoneUri == null) { return defaultRingtoneTitle; } Context context = getContext(); Ringtone ringtone = RingtoneManager.getRingtone(context, ringtoneUri); if (ringtone == null) { return defaultRingtoneTitle; } return ringtone.getTitle(context); }