ContactsContract.CommonDataKinds.Phone.CONTENT_URI vs ContactsContract.Contacts.CONTENT_URI
Asked Answered
H

1

6

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?

Helga answered 17/2, 2015 at 9:41 Comment(0)
I
6

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.

Isochromatic answered 12/3, 2015 at 22:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.