I can get a list of groups with the code below and I've bound them to a ListView. It's clickable and I get the NAME and _ID of the group. Similarly I can get a list of contacts with similar code. What I haven't been able to figure out i开发者_开发技巧s how to select a group and return only the contacts in that group.
I'm really trying to target Android 1.5.
ContentResolver cr = getContentResolver();
Cursor groupCur = cr.query(Groups.CONTENT_URI, null, null, null, null);
if (groupCur.getCount() > 0) {
while (groupCur.moveToNext()) {
...
}
}
Using the help here: Click Listener on ListView
I was able to get a Group._ID from the click and pass that to GroupMembership to get a list of people and finally query People with an IN where clause to get the members.
精彩评论