Vivek
Vivek

Reputation: 4260

How to Show contact photo in my application?

I want to show image of contacts(form contact list) in my application. How to do it?

Upvotes: 1

Views: 3214

Answers (2)

Vivek
Vivek

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

Fredrik Wallenius
Fredrik Wallenius

Reputation: 2872

Examine the code shown on this page and your problem should be solved:

http://thinkandroid.wordpress.com/2010/01/19/retrieving-contact-information-name-number-and-profile-picture/

Upvotes: 0

Related Questions