Hi all,

I'm writing midlets for Nokia N70 (Serie 60 with OS 8.1a) and I've installed the SDK "Series 60 2nd Edition SDK for Symbian OS, Supporting Feature Pack 3, for MIDP".
The problem is about a simple (in theory) YES/NO dialog implemented with an Alert: when the user presses 'NO' the command executed is the same as when he/she presses 'YES'.
Here's the code:

public class YesNoAlert extends MIDlet implements CommandListener
{
private Display display;
private Command yes;
private Command no;
private Alert alert;
private TextBox textBox;
public YesNoAlert()
{
display = Display.getDisplay(this);
textBox = new TextBox("HelloNokia", "Welcome to Nokia\n", 256, 0);

alert = new Alert("Alert YES/NO", "Press YES or NO", null, AlertType.CONFIRMATION);
yes = new Command("Yes", Command.OK, 1);
no = new Command("No", Command.CANCEL, 1);
alert.setTimeout(Alert.FOREVER);
alert.addCommand(yes);
alert.addCommand(no);

alert.setCommandListener(this);
}

public void commandAction(Command command, Displayable displayable)
{
if (command == yes)
textBox.setString("Pressed: YES");
else if (command == no)
textBox.setString("Pressed: NO");
else
textBox.setString("IMPOSSIBLE");
display.setCurrent(textBox);
}

protected void startApp() throws MIDletStateChangeException
{
display.setCurrent(alert);
}
...
}


The problem persists even if I change the no-command's 'priority' to '2' and/or 'commandType' to 'BACK'.
Instead, changing the Alert with a TextBox it works.

Any suggestions?

Thanks,
Giannandrea