I want to delete user name whose name is Leo. So I am putting delete query as follow
int i = getContentResolver().delete(Contacts.CONTENT_URI, Contacts.DISPLAY_NAME +"= 'Leo'",null);
System.out.println("rows deleted "+i);
but it returns "rows deleted 0"
what is wrong with it.
Edits :
The above is not working because the field is read only using Contacts.CONTENT_URI
You can see using following URI.
http://developer.android.com/reference/android/provider/ContactsContract.Contacts.html