Vote count:
0
I'm trying to play a ringtone using a ContentProvider, this works great using a contact ringtone (openFile | openAsset is called within my content provider)
final ContentValues values = new ContentValues();
values.put(ContactsContract.Contacts.CUSTOM_RINGTONE, MY_CONTENT_PROVIDER_URI.toString());
final Uri uri = Uri.withAppendedPath(
ContactsContract.Contacts.CONTENT_URI,
Uri.encode(String.valueOf(contact)));
mContext.getContentResolver().update(uri, values, null, null);
However won't work for the phone ringtone, my ContentProvider won't be called (Not even query()) and the system default ringtone will be played instead.
android.media.RingtoneManager.setActualDefaultRingtoneUri(
mContext,
android.media.RingtoneManager.TYPE_RINGTONE,
MY_CONTENT_PROVIDER_URI.toString());
Is this an android limitation?
asked 1 min ago
Can't play a ringtone from a ContentProvider
Aucun commentaire:
Enregistrer un commentaire