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

Disable menu items that cannot be used while disconnected

This commit is contained in:
Sebastian Kaspari 2010-04-12 00:55:34 +02:00
parent e6411b4747
commit a79794ba1d

View File

@ -224,6 +224,19 @@ public class ConversationActivity extends Activity implements ServiceConnection,
return true;
}
/**
* On prepare options menu
*/
@Override
public boolean onPrepareOptionsMenu(Menu menu)
{
menu.getItem(0).setEnabled(server.isConnected()); // join
menu.getItem(1).setEnabled(server.isConnected()); // users
menu.getItem(2).setEnabled(server.isConnected()); // close
return true;
}
/**
* On menu item selected