From what I've read using lookup_key is the best way to delete a contact. Each contact has a unique lookupkey, even if the contact is edited, whereas for example deleting by name or number etc...you could be deleting multiple entries.
Say if I have the lookup_key for a contact in my phonebook or sim :
String thelookupkey = 1393i2f.3789r504-2927292F4D4D2F35274949374B.2537i1272844629.1728i108
How can I delete this contact from my phone book. I know it's something like below, but not sure of the exact syntax (also, don't want to possibly ruin my phonebook while experimenting)
public void deletecontactbutton(View view) {
context.getContentResolver().delete(ContactsContract.Contacts.CONTENT_LOOKUP_URI,
null, thelookupkey);
}