From 3a3e4ae8220ab1f18ae1396deb54c18f5bb7f0db Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Wed, 10 Mar 2010 23:17:22 +0100 Subject: [PATCH] Only connect on click if not already connected or connecting --- src/org/yaaic/view/ServersActivity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/org/yaaic/view/ServersActivity.java b/src/org/yaaic/view/ServersActivity.java index e93ae67..f1bb09a 100644 --- a/src/org/yaaic/view/ServersActivity.java +++ b/src/org/yaaic/view/ServersActivity.java @@ -120,9 +120,11 @@ public class ServersActivity extends ListActivity implements ServiceConnection, protected void onListItemClick(ListView l, View v, int position, long id) { Server server = adapter.getItem(position); - server.setStatus(Status.CONNECTING); - adapter.notifyDataSetChanged(); - binder.connect(server); + if (server.getStatus() == Status.DISCONNECTED) { + server.setStatus(Status.CONNECTING); + adapter.notifyDataSetChanged(); + binder.connect(server); + } Intent intent = new Intent(this, ServerActivity.class); intent.putExtra("serverId", server.getId());