0

I have tried a lot to add icon in connections of contacts of android phone whne that contact is used by my app.But I not able to get even a single reference to do it.Please do the favourable.I tried to use this link

But not get any solution as its not properly explained.Simply I have to add icon like whats app goggle plus in phone contact if its used by my app

Davinder
  • 1
  • 1
  • 2

1 Answers1

0

This code works pretty well to get a photo, if I understand you correctly:

 Uri my_contact_Uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(id));
 InputStream photo_stream = ContactsContract.Contacts.openContactPhotoInputStream(cr, my_contact_Uri, true);
 BufferedInputStream buf = new BufferedInputStream(photo_stream);
 Bitmap my_btmp = BitmapFactory.decodeStream(buf);
 buf.close();
 return my_btmp;

Look at this question: Get high-res contact photo as bitmap below API level 14 Android for more info.

Community
  • 1
  • 1
ElectronicGeek
  • 3,312
  • 2
  • 23
  • 35
  • Its not the what I want.I got solution for it.E.g firstly create account using accountManager after that you are able to sync. contacts with your app having registered account – Davinder Mar 31 '14 at 09:08