Does anybody know how to get a list of contacts belonging to a 1 specific group in Android?
I need something like this:
Select * from contacts where group_id = "1234"
I am able to get a list of all contacts OR all groups by using something like this:
Cursor groupCursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
final ArrayList<String> contacts = new ArrayList<String>();
while(groupCursor.moveToNext()) {
String name = groupCursor.getString(groupCursor.getColumnIndex(ContactsContract.Constacts.DisplayName ));
contacts.add(name);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…