Senhores(as),
Não me zombem pela dúvida, sou iniciante em J2ME e estou com o seguinte problema:
Tenho uma aplicação que ao enviar dados ao servidor deve retornar ao usuario uma mensagem de ok e retorne ao menu principal. Para isso estou utilizando o código abaixo:
try{
CommandQueue.getInstance().add(comando);
FlashCommandQueue.getInstance().add(comandoFlash);
BaixaOnline.getInstance().getDisplay().setCurrent(Menu.getInstance());
Alert a = new Alert(“Ok”, “Operação efetuada com sucesso”, null, AlertType.INFO);
a.setTimeout(Alert.FOREVER);
BaixaOnline.getInstance().getDisplay().setCurrent(a);
}
catch(RecordStoreException e){
Alert a = new Alert(“Erro”, “Falha na Comunicação–record”, null,
AlertType.ERROR);
a.setTimeout(Alert.FOREVER);
BaixaOnline.getInstance().getDisplay().setCurrent(a);
e.printStackTrace();
BaixaOnline.getInstance().notifyDestroyed();
}
catch(IOException e){
Alert a = new Alert(“Erro”, “Falha na Comunicação–ioexception”, null,
AlertType.ERROR);
a.setTimeout(Alert.FOREVER);
BaixaOnline.getInstance().getDisplay().setCurrent(a, this);
e.printStackTrace();
BaixaOnline.getInstance().notifyDestroyed();
}
catch(Exception e){
Alert a = new Alert(“Erro”, “Falha na Comunicação—estou no exception”, null,
AlertType.ERROR);
a.setTimeout(Alert.FOREVER);
BaixaOnline.getInstance().getDisplay().setCurrent(a);
e.printStackTrace();
BaixaOnline.getInstance().notifyDestroyed();
}
percebam que primeiro chamo a tela principal em seguida exibo o alert. O problema é que no emulador funciona, mas no celular não.
Podem me ajudar, por favor?