安卓:如何排除来自ContentResolver的查询的Facebook联系人 [英] Android: How to Exclude Facebook Contacts from ContentResolver Query

查看:281
本文介绍了安卓:如何排除来自ContentResolver的查询的Facebook联系人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拉着所有使用此查询手机的联系人:

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");

如果用户同步他们的Facebook联系人,然后我得到的这个查询与其他内容一起。不过,我已经通过异步API调用拉动用户的Facebook联系人,所以我想从这个查询中排除Facebook联系人,以避免重复。

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.

有人能指出我朝着WHERE子句(选择参数)我需要包括,让我从什么是由该查询返回排除Facebook联系人?

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?

感谢您!

编辑:或者说,可以从ContentResolver的,让我手动过滤Facebook联系人中选择最起码只是一个领域?这将是一样好。

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.

推荐答案

嗯,只是一个想法。
也许你可以过滤查询来寻找谁有一个电话号码的联系人。
我假设Facebook联系人将被排除在外。
我可能是错的。有没有尝试过:)

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 :)

这篇关于安卓:如何排除来自ContentResolver的查询的Facebook联系人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆