Hopefully someone can point me in the right direction ...

In my application I want to set the ringtone to one of the resources
in my project. I have not got this to work, yet.

I'm setting the default ringer to a resource in my application with
the following code.

Uri mediaUri = Uri.parse("android.resource://
com.example.myapp/" + mediaId);
RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(),
RingtoneManager.TYPE_RINGTONE, mediaUri);

I can play the resource via the RingtoneManager with this code:
RingtoneManager.getRingtone(getApplicationContext(), mediaUri).play();

This plays the sound I would expect.

However, if I ask the RingtoneManager to play the default ringer, it
plays the default android ringer.
Here is the code I'm using to play the default ringer:

Uri defaultUri = RingtoneManager.getDefaultUri
(RingtoneManager.TYPE_RINGTONE);
Ringtone rt = RingtoneManager.getRingtone(getApplicationContext(),
defaultUri);

The question is...
Why is the "setActualDefaultRingtoneUri" method call not setting the
default ringer?

What am I doing wrong? I've searched many user forums, read the docs,
and all the news groups and I cant seem to find what I'm doing wrong.

Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to