How to get the defined Contact Groups on an Android?
I would like to get a list of Contacts Groups already 开发者_开发技巧defined in the system, how can I do that?
You can query the Contacts.Group table for the available groups.
You can use the Contacts.GroupMembership table to query what group a particular contact is a member of. PERSON_ID
is the ID of the contact, GROUP_ID
matches the ID of the group.
Note that both these APIs have been deprecated in favour of ContactsContract.Groups and ContactsContract.CommonDataKinds.GroupMembership from 2.0 onwards.
精彩评论