When I test the following code on S60, I get 2 problems
1) Under "Options" this in only "Exit", which exit the applcation. I don't want "Exit" shown up here,
while "Log in", which I expect, doesnt show up.
2) The even of itemStateChanged can't be trigged.
The same code works on S40 well. Anyone can kindly help?
public class MyForm extends Form
implements ItemStateListener,
private Command command1;
public MyForm() {
super("Ttile");
loginCommand = new Command("Log in", Command.OK, 0);
addCommand(new Command("Back", Command.BACK, 1));
setCommandListener(this);
setItemStateListener(this);
}
public void itemStateChanged(Item item) {
if (someCondition)
addCommand(loginCommand);
else
removeCommand(loginCommand);
}
public void commandAction(Command c, Displayable d) {
}
}

Reply With Quote


