The standard way of getting contact photos/uris from
ContactsContracts.Contacts.CONTENT_URI does not work for any photo
that is not of GOOGLE descent! meaning, if the contact does not have a
Google contact with a photo, then I cannot pull a contact photo.
This is not only my problem. I see that no one has really answered
this question.
I know that the Android Incoming Call Screen displays a Facebook photo
just fine, so I am not sure why I would need to do something
different!
Is there someone out there, from Google/Android, who can tell me what
I need to do?
Specifically I am doing this
Uri uri = Contacts.CONTENT_URI;
Cursor c_contact = this.getContentResolver()
.query(uri,
new String[] { BaseColumns._ID,
Contacts.DISPLAY_NAME },
Contacts.DISPLAY_NAME + "=?",
new String[] { displayName }, null);
try {
if (c_contact.moveToFirst()) {
do {
Log.v(Globals.Tag, c_contact.getString(0) + "-"
+ c_contact.getString(1));
Uri contact_uri = ContentUris
.withAppendedId(Contacts.CONTENT_URI,
c_contact
.getLong(0));
InputStream image_stream = Contacts
.openContactPhotoInputStream(this.getContentResolver(),
contact_uri);
if (image_stream == null) {
continue;
}
Bitmap bm =
BitmapFactory.decodeStream(image_stream);
ImageView iv = (ImageView) this
.findViewById(R.id.ImageView);
iv.setImageBitmap(bm);
} while (c_contact.moveToNext());
}
} finally {
c_contact.close();
}
I can see in the contacts database, Contacts table that there is a
photo_id that matches with a record in the Data table....
but i get nothing!!!!!!
ARGH!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe, reply using "remove me" as the subject.