1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-22 17:02:21 -05: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) { protected void onListItemClick(ListView l, View v, int position, long id) {
Server server = adapter.getItem(position); Server server = adapter.getItem(position);
if (server.getStatus() == Status.DISCONNECTED) {
server.setStatus(Status.CONNECTING); server.setStatus(Status.CONNECTING);
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
binder.connect(server); binder.connect(server);
}
Intent intent = new Intent(this, ServerActivity.class); Intent intent = new Intent(this, ServerActivity.class);
intent.putExtra("serverId", server.getId()); intent.putExtra("serverId", server.getId());