如何使用 Uri 获取铃声标题
How to get Title of Ringtone with Uri
我试试这个:
Uri ringtoneUri = "content://media/internal/audio/media/55";
Ringtone ringtone = RingtoneManager.getRingtone(context, ringtoneUri);
String name = ringtone.getTitle(context);
我得到的结果是:name = 55,不是像 "common name"
这样的普通标题
我也看到了Get the Ringtone title from RingtonePreference
但没有公认的答案
试试这个
Uri ringtoneUri = RingtoneManager
.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
Ringtone ringtone = RingtoneManager.getRingtone(this, ringtoneUri);
String title = ringtone.getTitle(this);
我试试这个:
Uri ringtoneUri = "content://media/internal/audio/media/55";
Ringtone ringtone = RingtoneManager.getRingtone(context, ringtoneUri);
String name = ringtone.getTitle(context);
我得到的结果是:name = 55,不是像 "common name"
这样的普通标题我也看到了Get the Ringtone title from RingtonePreference 但没有公认的答案
试试这个
Uri ringtoneUri = RingtoneManager
.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
Ringtone ringtone = RingtoneManager.getRingtone(this, ringtoneUri);
String title = ringtone.getTitle(this);