Using RingtoneManager.getRingtone on LG optimus

719 views Asked by At

I'm currently trying to play raw file as ringtone on LG optimus.

Uri uri = Uri.parse("android.resource://" + curContext.getPackageName() + "/" + R.raw.alert);
mDefaultRingtone = RingtoneManager.getRingtone(curContext, uri);
mDefaultRingtone.play();

I'm using this code on all other phones and it's fine. on the LG devices(i have 2 Optimus devices - OS 2.2.2 and 2.3.3) it always plays the default system ringtone and not my resource.

Help would be much appreciated

1

There are 1 answers

0
MaTriXy On

I FOUND AN OVERRIDE

just for the mDefaultRingtone i use a media player item.

MediaPlayer.create(this, mUriForDefaultItem);

Then upon click i play the sound according to list position.