diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-03-08 02:06:00 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-03-08 02:06:00 +0100 |
commit | 905a79fca8c0770276c3ee68f88883c7140c6cf6 (patch) | |
tree | 7dbf0be3e9de318c9ff8b0cc15f37e0dd431a731 /src/eu/siacs/conversations/ui | |
parent | a1b72313d7858a69c794d706e7ebb00a50a7000a (diff) |
fixed #3
Diffstat (limited to 'src/eu/siacs/conversations/ui')
-rw-r--r-- | src/eu/siacs/conversations/ui/ConversationActivity.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index 3d39eac7..f8e22dad 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -147,7 +147,12 @@ public class ConversationActivity extends XmppActivity { view = (View) inflater.inflate( R.layout.conversation_list_row, null); } - Conversation conv = getItem(position); + Conversation conv; + if (conversationList.size() > position) { + conv = getItem(position); + } else { + return view; + } if (!spl.isSlideable()) { if (conv==getSelectedConversation()) { view.setBackgroundColor(0xffdddddd); @@ -181,7 +186,7 @@ public class ConversationActivity extends XmppActivity { ((ImageView) view.findViewById(R.id.conversation_image)) - .setImageURI(getItem(position).getProfilePhotoUri()); + .setImageURI(conv.getProfilePhotoUri()); return view; } @@ -417,7 +422,6 @@ public class ConversationActivity extends XmppActivity { xmppConnectionService.setOnConversationListChangedListener(this.onConvChanged); if (conversationList.size()==0) { - conversationList.clear(); conversationList.addAll(xmppConnectionService .getConversations()); @@ -452,12 +456,9 @@ public class ConversationActivity extends XmppActivity { //find currently loaded fragment ConversationFragment selectedFragment = (ConversationFragment) getFragmentManager().findFragmentByTag("conversation"); if (selectedFragment!=null) { - Log.d("gultsch","ConversationActivity. found old fragment."); selectedFragment.onBackendConnected(); } else { - Log.d("gultsch","conversationactivity. no old fragment found. creating new one"); selectedConversation = conversationList.get(0); - Log.d("gultsch","selected conversation is #"+selectedConversation); swapConversationFragment(); } } |