ContactsContract.CommonDataKinds.Phone.CONTENT_URI vs ContactsContract.Contacts.CONTENT_URI

你说的曾经没有我的故事 提交于 2019-12-23 18:57:04

问题


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?

When can they be different?


回答1:


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.

Be sure to add .CONTENT_URI at the end of the Constant and check the documentation for more information.



来源:https://stackoverflow.com/questions/28558849/contactscontract-commondatakinds-phone-content-uri-vs-contactscontract-contacts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!