Ok, I'm going batty. I've been messing with this for a bit. Shouldn't deleting a single contact once you know the contact_id be this simple? This delete runs, throws no error, but doesn't delete the contact.
the Log information show something like:
delete contact_id = '615'
delete return code : 0
This is the code involved:
private static int deleteContact(Context c, String id) {
String where = ContactsContract.Data.CONTACT_ID + " = '" + id + "'";
int rc = -1;
try {
Log.i("delete", where);
rc = c.getContentResolver().delete(ContactsContract.Contacts.CONTENT_URI, where, null);
Log.i("delete",String.format("return code : %d", rc));
} catch (Exception e) {
System.out.println(e.getStackTrace());
}
return rc;
}
Can someone help me find a solution or suggest an alternative?