1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-11 13:48:21 -05:00

Directly jump to server view on click and watch the client connecting

This commit is contained in:
Sebastian Kaspari 2010-03-10 23:09:39 +01:00
parent dda143186b
commit ac48ee9aae

View File

@ -118,20 +118,15 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
*/ */
@Override @Override
protected void onListItemClick(ListView l, View v, int position, long id) { protected void onListItemClick(ListView l, View v, int position, long id) {
final Server server = adapter.getItem(position); Server server = adapter.getItem(position);
switch (server.getStatus()) { server.setStatus(Status.CONNECTING);
case Status.DISCONNECTED: adapter.notifyDataSetChanged();
server.setStatus(Status.CONNECTING); binder.connect(server);
adapter.notifyDataSetChanged();
binder.connect(server); Intent intent = new Intent(this, ServerActivity.class);
break; intent.putExtra("serverId", server.getId());
case Status.CONNECTED: startActivityForResult(intent, 0);
Intent intent = new Intent(this, ServerActivity.class);
intent.putExtra("serverId", server.getId());
startActivityForResult(intent, 0);
break;
}
} }
/** /**