Original Post
Hey guys. I'm having some trouble here with this. I created an option for the menu of the softkeys, but, when i try it in any mobile hand set, it doesn't appear. What's wrong with it? Thanks
[source code=javax]
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MainBase extends MIDlet implements CommandListener
{
private Display desplegar;
private Command comandoSalir;//Comando de Salida
private GameAlfaClass comic;
public int opcion=99;
public boolean isPlay=true;
public boolean isOut=true;
public void startApp() throws MIDletStateChangeException
{
desplegar = Display.getDisplay(this);
program=new GameAlfaClass(this);
comandoSalir = new Command("Correr",Command.EXIT,2);
program.addCommand(comandoSalir);
program.setCommandListener(this);
try
{
program.start();
desplegar.setCurrent(comic);
isOut = true;
while (isOut){}
program.stop();
program = null;
}
catch (Exception ex)
{
System.out.println(ex);
}
notifyDestroyed();
}
public Display getDisplay()
{
return desplegar;
}
public void pauseApp()
{
program.stop();
try { Thread.sleep(1000); }//esperar medio segundo para dar consistencia
catch (InterruptedException ie) {}
}
public void destroyApp(boolean unconditional)
{
program.stop();
try { Thread.sleep(1000); }//esperar medio segundo para dar consistencia
catch (InterruptedException ie) {}
}
public void commandAction(Command c, Displayable s)
{
if (c == comandoSalir)
{
destroyApp(true);
}
}
}
[/source code]