如何搜索没有群组的联系人
我有一个关于 Android 联系人的问题。我想查询所有未分配给任何组的联系人,但我不确定搜索条件,我的意思是,有时,GroupMembership.GROUP_ROW_ID 为 null 如果联系人没有组,但有时 GroupMembership.GROUP_ROW_ID 为 -1 。谁能告诉我如何搜索没有群组的所有联系人?
I have a question about android contacts. I want to query all contacts have not assigned to any group, but I am not sure about the search condition, I mean, sometimes, the GroupMembership.GROUP_ROW_ID is null If the contacts have no group, but sometimes the GroupMembership.GROUP_ROW_ID is -1. Can anyone tell me how to search all contacts have no group?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有点粗糙,但对我有用。我找不到一种无需执行两次查询即可在任何组中查找联系人的简单方法。
您可能可以优化查询以删除重复项,从而消除对“foundIds”集的需要。
This is a little crude, but it works for me. I couldn't see an easy way of finding contacts in no group without doing two queries.
It's likely that you can optimise the query to remove duplicates, thus removing the need for the 'foundIds' set.