I'm new to android dev, so I may get the whole concept totally wrong. I want to delete a specific entry from RawContact directory entry. Here is code that I have:
Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId);
Uri entityUri = Uri.withAppendedPath(rawContactUri, Entity.CONTENT_DIRECTORY);
Cursor c = getContentResolver().query(entityUri,
new String[]{RawContacts._ID, Entity.DATA_ID, Entity.MIMETYPE,CommonDataKinds.GroupMembership.GROUP_SOURCE_ID},
null, null, null);
using cursor c I get appropriate Entity.DATA_ID. After that I try to delete an entry:
getContentResolver().delete(entityUri,Entity.DATA_ID+"=?",
new String[]{id});
and get an error:
java.lang.UnsupportedOperationException: URI: content://com.android.contacts/raw_contacts/2709/entity
What am I doing wrong?
UPD 1 I am trying to remove group membership entry.