开发者

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

开发者 https://www.devze.com 2023-01-10 04:44 出处:网络
The question is \"How to get a list of favorite contacts with android sdk?\". Now I am using android 开发者_开发技巧v1.5.

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

精彩评论

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