开发者

select contact detail where People._ID = contact ID in android

开发者 https://www.devze.com 2023-02-01 08:49 出处:网络
I\'m developing application in android. I have contactID, so how c开发者_如何学运维an I fetch particular People._ID record from contact list?If you use the new ContactsContract API:

I'm developing application in android. I have contactID, so how c开发者_如何学运维an I fetch particular People._ID record from contact list?


If you use the new ContactsContract API:

String selection = ContactsContract.Data.CONTACT_ID +" = ?";
String[] selectionArgs = new String[]{id}
Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, selection, selectionArgs, null);

As you see, you have to use the selection- and selectionArgsParameters of the query-Methode to achieve the where clause.

0

精彩评论

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

关注公众号