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

Barmaley picture Barmaley · Jul 25, 2012 · Viewed 9.6k times · Source

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?

Answer

onosendai picture onosendai · Jul 25, 2012

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.