How is it possible to get (contact) Group ID's using a raw contact ID?
<p>I have the following code:</p>

<pre><code>    //get group ID's
    // note: a contact can belong to multiple groups
    final String where = ContactsContract.Data.RAW_CONTACT_ID + "=" + contactID
    + " AND "
    + ContactsContract.Data.MIMETYPE + "='" + ContactsContract.CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE + "'";

    final String[] projectionGroups = new String[] { ContactsContract.Data.DATA1 };//DATA1 is GroupID

    Cursor curGroup = getContentResolver().query(
            ContactsContract.Data.CONTENT_URI,
            projectionGroups,
            where,
            null,
            null);

    if (curGroup != null)
    {
        Log.i(TAG, "group count "+curGroup.getCount());
    }
</code></pre>

<p>However, it always returns a count of 0.</p>

<p>Is there something wrong with the query ? I am using this on my phone running Android 2.3.5</p>
