0

I would like to know how to lookup contact photo URI using the lookup key of the contact. i have already implemented it using the contact id. but now i want it to be implemented using lookup key because of android contact aggregation feature.

my current implementation

public Uri getPhotoUri(String lookup) 
    {

        Uri person = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long
                .parseLong(lookup));
        return Uri.withAppendedPath(person, ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
    }

Thanks in advance

Phil Lello
  • 8,377
  • 2
  • 25
  • 34
rogue-one
  • 11,259
  • 7
  • 53
  • 75
  • I believe using _id rather than lookupid would be more efficient in querying the database. any thoughts on this? – rogue-one Apr 24 '11 at 15:02

1 Answers1

1

if you using _id(contact id), when the contact connect to another contact, this id will be changed.

so you dont have to use contact id.

why don't you use raw contact id to find contact id?

Brad Hong
  • 389
  • 2
  • 11
  • 1
    relative link is here : http://stackoverflow.com/questions/3940864/android-manage-contacts-with-lookup-key – Brad Hong Apr 27 '11 at 12:22