diff --git a/src/org/yaaic/model/Server.java b/src/org/yaaic/model/Server.java index adbe9ba..bdd3c88 100644 --- a/src/org/yaaic/model/Server.java +++ b/src/org/yaaic/model/Server.java @@ -40,6 +40,7 @@ public class Server private HashMap conversations = new HashMap(); private int status = Status.DISCONNECTED; + private String selected = ""; /** * Create a new server object @@ -47,6 +48,7 @@ public class Server public Server() { conversations.put(ServerInfo.DEFAULT_NAME, new ServerInfo()); + this.selected = ServerInfo.DEFAULT_NAME; } /** @@ -216,6 +218,26 @@ public class Server conversations.clear(); } + /** + * Set name of currently selected conversation + * + * @param selected The name of the selected conversation + */ + public void setSelectedConversation(String selected) + { + this.selected = selected; + } + + /** + * Get name of currently selected conversation + * + * @return The name of the selected conversation + */ + public String getSelectedConversation() + { + return selected; + } + /** * Get icon for current server status * diff --git a/src/org/yaaic/view/ServerActivity.java b/src/org/yaaic/view/ServerActivity.java index bb9a197..ab9d967 100644 --- a/src/org/yaaic/view/ServerActivity.java +++ b/src/org/yaaic/view/ServerActivity.java @@ -355,6 +355,11 @@ public class ServerActivity extends Activity implements ServiceConnection, Chann } else { onNothingSelected(deck); } + + // Remember selection + if (conversation != null) { + server.setSelectedConversation(conversation.getName()); + } } /**