I'm using RingtoneManager, and apparently on some phones it returns null all of the time. I know it returns null if the sound is silent or it cant find the tone. Why would null be returned if the sound is on and there is a tone? The code works on my nexus s....
Here is what I am using:
Ringtone ringtone;
ringtone = RingtoneManager.getRingtone(context, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
if(ringtone == null)
{
Log.d("Debug", "ringtone is null");
}
else
{
ringtone.play();
}
I have all permissions enabled to play ringtone (it works on my phone) and even have SD card permissions enabled just in case the ringtone is on the SD card. Any thoughts?
"Failed to open ringtone " + ringtoneUri
in logcat. Are you seeing such lines in your logcat output? – Motherly