Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get URI current/default ringtone for incoming SMS?

I am writing application which intented to replace standard/stock messenger. So I need to define default ringtone for incoming messages. I mean incoming SMS notification ringtone.

Anyone knows how to get it?

like image 523
Barmaley Avatar asked Jul 25 '12 13:07

Barmaley


1 Answers

To retrieve the Ringtone object of the default ringtone, use the RingtoneManager:

Ringtone ringtone = RingtoneManager.getRingtone(context, Settings.System.DEFAULT_RINGTONE_URI);

If the user has changed the default ringtone to a ringtone provided in a 3rd party messager app, AFAIK you can't access the new ringtone unless the 3rd party app exposes its ringtones via a ContentProvider.

like image 155
onosendai Avatar answered Sep 24 '22 00:09

onosendai