1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-11-04 16:35:05 -05:00

Moved connect from ServersActivity to ConversationActivity for faster responses

This commit is contained in:
Sebastian Kaspari 2010-03-20 20:21:51 +01:00
parent 3ca4ea981c
commit 70c9ab644b
2 changed files with 10 additions and 4 deletions

View File

@ -166,6 +166,11 @@ public class ConversationActivity extends Activity implements ServiceConnection,
public void onServiceConnected(ComponentName name, IBinder service)
{
this.binder = (IRCBinder) service;
// connect to irc server if connect has been requested
if (!server.isConnected() && getIntent().hasExtra("connect")) {
binder.connect(server);
}
}
/**

View File

@ -134,12 +134,13 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
protected void onListItemClick(ListView l, View v, int position, long id) {
Server server = adapter.getItem(position);
Intent intent = new Intent(this, ConversationActivity.class);
if (server.getStatus() == Status.DISCONNECTED) {
server.setStatus(Status.CONNECTING);
binder.connect(server);
}
Intent intent = new Intent(this, ConversationActivity.class);
intent.putExtra("connect", true);
}
intent.putExtra("serverId", server.getId());
startActivity(intent);
}