Set ringtone from raw resource?

by Bryan Vincent » Mon, 16 Nov 2009 12:52:13 GMT


Sponsored Links
 So I'm having a hard time setting a ringtone from a raw resource. My
code is below. Any help would be much appreciated.

RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(),
RingtoneManager.TYPE_NOTIFICATION, Uri.parse("android.resource://
net.thebosskey.gijoepsasoundboard/" + this.resource));

However, when I play back the default notification sound using the
line below, it is not my sound.
RingtoneManager.getRingtone(getApplicationContext(),
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)).play
();

I know the uri for my sound is correct because the following line
plays it:
RingtoneManager.getRingtone(getApplicationContext(), Uri.parse
("android.resource://net.thebosskey.gijoepsasoundboard/" +
this.resource)).play();

What am I doing wrong?

--



Set ringtone from raw resource?

by Open » Fri, 18 Dec 2009 07:38:46 GMT


 Did you solve this problem?

I'm having the same trouble when using a 2.0 emulator.  The Ringtone
manager doesn't play my raw resource sound, it plays the default phone
ringtone.





--


Sponsored Links