如何获得只喜欢使用ContactsContract /收藏的联系人 [英] How to get only the favourite/starred contacts using ContactsContract

查看:101
本文介绍了如何获得只喜欢使用ContactsContract /收藏的联系人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能得到常用联系人(只有喜欢/主演)联系人?

how can I get the favourite contacts (and only the favorite / starred) contacts?

我想通过整个联系人列表检查每个接触不循环,如果它是出演......有一些查询,我可以用它来只返回最喜欢/收藏的联系人?

I would like to not loop through the entire contacts list checking each contact if it is starred... is there some query I can use to return only favourite/starred contacts?

感谢

推荐答案

您可以做这样的事情:

Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, "starred=?",
            new String[] {"1"}, null);

其中出演=?将是你的过滤器和1建议拿起唯一的最爱。

where the starred=? will be your filter and "1" would suggest to pick up only favorites.

这篇关于如何获得只喜欢使用ContactsContract /收藏的联系人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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