Bom Tarde!
É o seguinte, eu criei um Command , criei uma ImageItem e adicionei o Command na imagem, fiz o append no form, eu utilizo o getForm que retorna meu form com alguns comandos e com setCommandListener para os comandos, olhando está tudo certo, porém, ao rodar em Windows Phone 6.5 Professional e emulando com a IBM MIDP 2.0 e pressionando o “botão criado” na tela touch ocorre que commandAction(Command command, Item item) é chamado duas(2) vezes, executando a ação dobrada, eu fiz algo errado, mais não consigo achar.
Me ajudem.
agradeço desde já.
private Command getCommandSubir() {
if(this.commandSubir==null){
this.commandSubir = new Command("Subir", Command.ITEM, 3);
}
return this.commandSubir;
}
public ImageItem getImagemSubir() {
if(imagemSubir == null){
imagemSubir = new ImageItem(null,getImageSubir(), Item.LAYOUT_BOTTOM, "Subir", Item.BUTTON);//Image.createImage("/mobile/rsc/subir.png");
imagemSubir.setDefaultCommand(getCommandSubir());
imagemSubir.setItemCommandListener(this);
}
return imagemSubir;
}
//------------------------------------------
getFormMeu().append(getImagemSubir());
getFormMeu()setCommandListener(this);
getFormMeu().setItemStateListener(listener);
switchDisplayable(null, getFormMeu());