How to get the group ID of a contact in android?

Android Get Group of Contact by ID

  • I have a contact ID, how do I get the group the contact is assigned to? I am sure it is something to do with the Contacts.Groups class but I cannot figure it out. Thanks, Isaac

  • Answer:

    In GroupMembership.PERSON_ID yo have the ID of the Person, and in the same table GroupMembership.GROUP_ID you have the ID of the group. You can retrieve the groups with the Contacts.Groups. Remember that in every "table" there is and unique ID to identify the row. Hope this helps. (Im working on it too)

Isaac Waller at Stack Overflow Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.