ContactsContract.CommonDataKinds.Phone.CONTENT_URI和ContactsContract.Contacts.CONTENT_URI [英] ContactsContract.CommonDataKinds.Phone.CONTENT_URI vs ContactsContract.Contacts.CONTENT_URI

查看:664
本文介绍了ContactsContract.CommonDataKinds.Phone.CONTENT_URI和ContactsContract.Contacts.CONTENT_URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在android中检索联系人列表我看到了允许您使用ContactsContract.CommonDataKinds.Phone.CONTENT_URIContactsContract.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

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆