开发者

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

The question is "How to get a list of favorite contacts with android sdk?". Now I am using android 开发者_开发技巧v1.5. Thanks.


See: Intent URI to go to favorite contacts


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 - yes, 0 - no

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜