I have an app that shows an ad matrix (buttons). For each ad there is a different link. When a link with a gif animation is activated, only a black screen is displayed, otherwise the page will be displayed without any problem.
My code.
private void muestraOfertas(Container cnOfertas, Vector vAnuncios) {
cnOfertas.removeAll();
cnOfertas.setScrollableY(true);
Container cntB = new Container();
int size = Display.getInstance().convertToPixels(15);
int ancho = Display.getInstance().getDisplayWidth();
ancho = (int) (ancho - (ancho * 0.03d));
boolean ciclo = true;
int c = 2;
while (ciclo) {
c++;
size = (int) (ancho / c);
int r = ancho % c;
if (r <= 0 || c >= vAnuncios.size()) {
ciclo = false;
}
};
vAnuncios = priorizaCampanas(vAnuncios);
Button bt[];
bt = new Button[vAnuncios.size()];
for (int i = 0; i < vAnuncios.size(); i++) {
Campana1 cM1 = (Campana1) vAnuncios.elementAt(i);
bt[i] = new Button();
bt[i].setUIID("Label");
Image img;
if (cM1.getRutaLogo().equals("") || cM1.getRutaLogo().equals("null")) {
img = res.getImage("promo.png").scaled(size, size);
} else {
EncodedImage lugar = EncodedImage.createFromImage(Image.createImage(size, size, 0xffcccccc), true);
img = URLImage.createToStorage(lugar, Integer.toString(cM1.getCampana()), cM1.getRutaLogo());
}
bt[i].setIcon(img);
cntB.addComponent(bt[i]);
bt[i].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
Display.getInstance().execute(cM1.getEnlace());
}
});
}
Container cnCentro = new Container(new BoxLayout(BoxLayout.Y_AXIS)).add(cntB);
cnOfertas.add(BorderLayout.CENTER, cnCentro);
}