Hi,
Could somebody help me with following code.
I trying to catch Command.EXIT on Nokia S60.
When I run this midlet on 6310i emulator or
Sun J2ME wtk 1.0.4 it works fine (i'm getting
the "Test" command binded to one of soft keys).
But when I'm trying to run this code on Series 60
emulator or real phone (N7650) I'm getting menu
"Options" binded to left soft key with sigle
item "Exit" inside. And selection of this item doesn't
affect calling of commandAction method of MyCanvas
class.
So, the question is it possible to remove or handle
somehow "Exit" menu item on Series 60 phones?
Vadim.
package menutest;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MenuTest extends MIDlet
{
MyCanvas screen = null;
public MenuTest()
{
screen = new MyCanvas();
}
protected void startApp()
{
Display.getDisplay(this).setCurrent(screen);
}
protected void pauseApp()
{
}
protected void destroyApp(boolean parm1)
{
Display.getDisplay(this).setCurrent(null);
notifyDestroyed();
}
}
class MyCanvas extends Canvas implements CommandListener
{
public MyCanvas()
{
addCommand(new Command("Test", Command.EXIT, 0));
setCommandListener(this);
}
protected void paint(Graphics gr)
{
}
public void commandAction(Command c, Displayable d)
{
System.out.println(c.getLabel());
}
}


Reply With Quote

