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
http://developer.android.com/resources/samples/SampleSyncAdapter/index.html
In above link I can able to find the solution. I can able to delete contacts completely.
The problem is related to sync adapter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With