diff --git a/application/src/org/yaaic/activity/ConversationActivity.java b/application/src/org/yaaic/activity/ConversationActivity.java index c72a871..ecfa693 100644 --- a/application/src/org/yaaic/activity/ConversationActivity.java +++ b/application/src/org/yaaic/activity/ConversationActivity.java @@ -166,7 +166,12 @@ public class ConversationActivity extends Activity implements ServiceConnection, Collection mConversations = server.getConversations(); for (Conversation conversation : mConversations) { - onNewConversation(conversation.getName()); + // Only scroll to new conversation if it was selected before + if (conversation.getStatus() == Conversation.STATUS_SELECTED) { + onNewConversation(conversation.getName()); + } else { + createNewConversation(conversation.getName()); + } } // keep compatibility with api level 3 @@ -430,13 +435,17 @@ public class ConversationActivity extends Activity implements ServiceConnection, @Override public void onNewConversation(String target) { - deckAdapter.addItem(server.getConversation(target)); + createNewConversation(target); if (!deckAdapter.isSwitched()) { // Scroll to new conversation deck.setSelection(deckAdapter.getCount() - 1); } } + public void createNewConversation(String target) + { + deckAdapter.addItem(server.getConversation(target)); + } /** * On conversation remove