3

How can I retrieve the current custom ringtone path assigned to a contact with Android? Are they all stored in a special folder?

ContactsContract.Data.CUSTOM_RINGTONE

Thanks for your help.

EDIT: I need the actual sound file in a byte array or something similiar.

Coder949
  • 987
  • 1
  • 8
  • 29

1 Answers1

0

It is like a normal field. To get the path I had to do:

int customRingtoneIndex = contactCursor.getColumnIndex(ContactsContract.Data.CUSTOM_RINGTONE);
String customRingtone = contactCursor.getString(customRingtoneIndex);

That returns the path to the actual content e.g. content://media/internal/audio/media/162

Coder949
  • 987
  • 1
  • 8
  • 29