1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-08-13 16:53:50 -04:00

Only connect on click if not already connected or connecting

This commit is contained in:
Sebastian Kaspari 2010-03-10 23:17:22 +01:00
parent 9efb7b8e4a
commit 3a3e4ae822

View File

@ -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());