繁体   English   中英

如何使用android sdk获取最喜欢的联系人列表?

[英]How to get a list of favorite contacts with android sdk?

问题是“如何使用 android sdk 获取最喜欢的联系人列表?”。 现在我使用的是 android v1.5。 谢谢。

Cursor cursor = this.managedQuery(
    ContactsContract.Contacts.CONTENT_URI, projection, "starred=?",
    new String[] {"1"}, null);
    Cursor cursor = context.getContentResolver().query(
                        ContactsContract.Contacts.CONTENT_URI,
                        null,
                        null,
                        null,
                        null);
int favorite = cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts.STARRED));

1 - 是,0 - 否

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM