下面代码就是获取到用户通讯录头像的代码:
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);
最简洁的获取联系人头像的代码
时间: 2024-10-22 00:19:38