Disable input if not connected

This commit is contained in:
Sebastian Kaspari 2010-03-10 23:12:01 +01:00
parent ac48ee9aae
commit 9efb7b8e4a
1 changed files with 7 additions and 1 deletions

View File

@ -95,7 +95,13 @@ public class ServerActivity extends Activity implements ServiceConnection, Chann
((TextView) findViewById(R.id.title)).setText(server.getTitle());
((ImageView) findViewById(R.id.status)).setImageResource(server.getStatusIcon());
((EditText) findViewById(R.id.input)).setOnKeyListener(this);
EditText input = (EditText) findViewById(R.id.input);
input.setOnKeyListener(this);
if (!server.isConnected()) {
input.setEnabled(false);
}
deck = (Gallery) findViewById(R.id.deck);
deck.setOnItemSelectedListener(this);