Как отобразить фотографию контакта с идентификатором контакта?
Этот код (внутри моегоCustomAdapter class) отображает только идентификатор контакта на основе того, кто отправил мне текстовые сообщения и помещает их в ArrayList, затем отображает список.
У меня есть ImageView называетсяholder.photo
рядом с каждым идентификатором контакта.How would I go about displaying the contact's photo in the in the ImageView?
String folder = "content://sms/inbox/";
Uri mSmsQueryUri = Uri.parse(folder);
messages = new ArrayList<String>();
contactID = new ArrayList<String>();
SMS = new ArrayList<String>();
try {
c = context.getContentResolver().query(mSmsQueryUri,
new String[] { "_id", "address", "date", "body" },
null, null, null);
if (c == null) {
Log.i(TAG, "cursor is null. uri: " + mSmsQueryUri);
}
} catch (Exception e) {
//Log.e(TAG, e.getMessage());
} finally {
c.close();
}
c.moveToFirst();
while (c.moveToNext()) {
phoneNumber = c.getString(0);
contactID.add(phoneNumber);
}
holder.photo.?????
//contact will cycle through all names and display each in a listview.
holder.contact.setText(contactID.get(position);
В настоящее время мой список отображает это:
android_icon-----John Doe android_icon-----Jane Smith android_icon-----Foo Barr