Reputation: 4260
I want to show image of contacts(form contact list) in my application. How to do it?
Upvotes: 1
Views: 3214
Reputation: 4260
I got the answer
public static Bitmap loadContactPhoto(ContentResolver cr, long id) {
Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, id);
InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(cr, uri);
if (input == null) {
return null;
}
return BitmapFactory.decodeStream(input);
}
Upvotes: 3
Reputation: 2872
Examine the code shown on this page and your problem should be solved:
Upvotes: 0