aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/ui/ConversationFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/gultsch/chat/ui/ConversationFragment.java')
-rw-r--r--src/de/gultsch/chat/ui/ConversationFragment.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/de/gultsch/chat/ui/ConversationFragment.java b/src/de/gultsch/chat/ui/ConversationFragment.java
index c3b73ac5..57d4b1eb 100644
--- a/src/de/gultsch/chat/ui/ConversationFragment.java
+++ b/src/de/gultsch/chat/ui/ConversationFragment.java
@@ -116,13 +116,16 @@ public class ConversationFragment extends Fragment {
} else {
Log.d("gultsch", "recylecd a view");
}
+ ImageView imageView = (ImageView) view.findViewById(R.id.message_photo);
if (type == RECIEVED) {
- ((ImageView) view.findViewById(R.id.message_photo))
- .setImageURI(item.getConversation()
- .getProfilePhotoUri());
+ Uri uri = item.getConversation().getProfilePhotoUri();
+ if (uri!=null) {
+ imageView.setImageURI(uri);
+ } else {
+ imageView.setImageBitmap(Beautifier.getUnknownContactPicture(item.getConversation().getName(), 200));
+ }
} else {
- ((ImageView) view.findViewById(R.id.message_photo))
- .setImageURI(profilePicture);
+ imageView.setImageURI(profilePicture);
}
((TextView) view.findViewById(R.id.message_body)).setText(item
.getBody());