diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-18 11:57:28 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-04-18 11:57:28 +0200 |
commit | 1e5f916b2a61b90c610614178bcd4c971817c83d (patch) | |
tree | f80061b8dfe12cb89ca4774e66df15818d03ddb8 /src/eu/siacs/conversations/ui | |
parent | 8cc72b5a56569803296bf8970a06a4706fadd0e1 (diff) |
tried to avoid some more race conditions in jingle
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r-- | src/eu/siacs/conversations/ui/ConversationFragment.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index f43f37a3..6e1db2bf 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -1,5 +1,6 @@ package eu.siacs.conversations.ui; +import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; @@ -277,9 +278,16 @@ public class ConversationFragment extends Fragment { viewHolder.messageBody.setTextColor(0xff33B5E5); viewHolder.messageBody.setTypeface(null,Typeface.ITALIC); } else { - viewHolder.image.setImageBitmap(activity.xmppConnectionService.getFileBackend().getThumbnailFromMessage(item,(int) (metrics.density * 288))); - viewHolder.messageBody.setVisibility(View.GONE); - viewHolder.image.setVisibility(View.VISIBLE); + try { + Bitmap thumbnail = activity.xmppConnectionService.getFileBackend().getThumbnailFromMessage(item,(int) (metrics.density * 288)); + viewHolder.image.setImageBitmap(thumbnail); + viewHolder.messageBody.setVisibility(View.GONE); + viewHolder.image.setVisibility(View.VISIBLE); + } catch (FileNotFoundException e) { + viewHolder.image.setVisibility(View.GONE); + viewHolder.messageBody.setText("error loading image file"); + viewHolder.messageBody.setVisibility(View.VISIBLE); + } } } else { viewHolder.image.setVisibility(View.GONE); |