Another issue with the code, each case is supposed to always have "break;" as the last liine.
case 1: canvas = new mostrarfotos(fotos[5]);
canvas.addCommand(exit);
canvas.addCommand(back);
canvas.setCommandListener(this) ;
pantalla.setCurrent(canvas);
break;
I have never used curley braces with the case either as you seem to have in your code. Mine look like this:
switch(i){
case o:
doThis();
break;
case 1:
doThat();
break;
}
curley braces only around the switch