正文  设备功能 > 联系人/Contacts >

最简洁的获取联系人头像的代码

ContentResolver cr = view.getContext().getContentResolver();Uri uri = ContentUris.withAppendedI...

ContentResolver cr = view.getContext().getContentResolver();
Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,
Long.parseLong(contact.contact_id));
InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(cr, uri);
Bitmap photo = BitmapFactory.decodeStream(input);