2

I am pulling all of the phone's contacts using this query:

    Cursor c = cr.query(ContactsContract.Data.CONTENT_URI, new String[] { ContactsContract.Contacts.PHOTO_ID, ContactsContract.Data.DISPLAY_NAME, ContactsContract.Contacts.LOOKUP_KEY }, null, null, ContactsContract.Data.LOOKUP_KEY + " ASC");

If the user has synced their Facebook contacts, then I get those in this query along with everything else. However, I am already pulling the user's Facebook contacts via an asynchronous API call so I want to EXCLUDE Facebook contacts from this query to avoid duplication.

Can someone point me towards the WHERE clause(selection param) I need to include that will allow me to exclude Facebook contacts from what is returned by this query?

Thank you!

Edit: Or at the very least just a field that can be selected from the ContentResolver that will allow me to manually filter the Facebook contacts? That would be just as good.

Jon W
  • 189
  • 2
  • 10

1 Answers1

0

Ummm, just a thought. Maybe you can filter your query to look for contacts who have a phone number. I assume Facebook contacts will be excluded. I might be wrong though. Haven't tried that :)

Alon Minski
  • 1,571
  • 2
  • 19
  • 32