2

I try this:

Uri ringtoneUri = "content://media/internal/audio/media/55";
Ringtone ringtone = RingtoneManager.getRingtone(context, ringtoneUri);
String name = ringtone.getTitle(context);

and I got result: name = 55, not a normal title like "common name"

I also saw Get the Ringtone title from RingtonePreference but there no accepted answer

tuanvn91
  • 1,159
  • 1
  • 6
  • 8

1 Answers1

-1

try this

  Uri ringtoneUri = RingtoneManager
                .getDefaultUri(RingtoneManager.TYPE_RINGTONE);
        Ringtone ringtone = RingtoneManager.getRingtone(this, ringtoneUri);
        String title = ringtone.getTitle(this);

  • This should not be the accepted answer. You're using Uri for general ringtone, and the question is asking for a ringtone for a specific contact. – Abhishek Kumar Jul 20 '20 at 07:04