File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes Get contacts by group name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Get contacts by group name" Watch "Get contacts by group name" New topic

Get contacts by group name

Jake Ikedichi

Joined: Jan 04, 2013
Posts: 1
I am working on an android project. Trying to select all contacts belonging to a specific group. So, I'll like to get all the contacts in a group called Work
Below is my select statement

String select = "((" + Contacts.DISPLAY_NAME + " NOTNULL) AND ("
+ Contacts.HAS_PHONE_NUMBER + "=1) AND ("
+ Contacts.DISPLAY_NAME + " != '' ))";

I am passing the above select statement to a CursorLoader object, which works fine for getting all contacts. But I will like to add another clause like "(" + Contacts.GROUP_NAME + "=Work)" for getting only the work group
Please help..Thanks in advance
I agree. Here's the link:
subject: Get contacts by group name
It's not a secret anymore!