如何删除Android的联系? [英] How to delete contact in android?
问题描述
我要删除他的名字是狮子座的用户名。所以,我把删除查询如下
INT I = getContentResolver()删除(Contacts.CONTENT_URI,Contacts.DISPLAY_NAME +=狮子座,NULL);
的System.out.println(删除行+ I);
但它返回行删除0
块引用>什么是错的吧。
的编辑:的
上述不工作,因为该字段为只读使用Contacts.CONTENT_URI
您可以看到使用以下URI。
的http://developer.android.com/reference/android/provider/ContactsContract.Contacts.html解决方案HTTP: //developer.android.com/resources/samples/SampleSyncAdapter/index.html
在上面的链接,我可以能够找到解决方案。我可以能够彻底删除联系人。
问题与同步适配器。
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.
这篇关于如何删除Android的联系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!