问题描述
如何在android中检索联系人列表我看到了允许您使用ContactsContract.CommonDataKinds.Phone.CONTENT_URI
或ContactsContract.Contacts.CONTENT_URI
读取联系人的代码.
In how to retrieve the list of contacts in android I see code that allows you to read contacts using either ContactsContract.CommonDataKinds.Phone.CONTENT_URI
or ContactsContract.Contacts.CONTENT_URI
.
它们之间有什么区别?
What is the difference between them?
什么时候可以不同?
推荐答案
使用 ContactsContract.Contacts
来查询 just Contacts 和 ContactsContract.CommonDataKinds.Phone
查询诸如电话号码之类的详细信息.
Use ContactsContract.Contacts
to query just Contacts and ContactsContract.CommonDataKinds.Phone
can be used to query for details like Phone Numbers if you have the ID of a contact.
请确保在常量的末尾添加.CONTENT_URI
,并查看文档以获取更多信息.
Be sure to add .CONTENT_URI
at the end of the Constant and check the documentation for more information.
这篇关于ContactsContract.CommonDataKinds.Phone.CONTENT_URI和ContactsContract.Contacts.CONTENT_URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!