Multiple Canvas Issue
Hello everyone!
I am implementing my MIDP application into different canvasses to maximize readability, however, when I shift / transfer to another canvas, the screen flickers showing a white background before showing the next canvas display.
Is there any way to solve this? Any help that could lead me to the solution will be greatly appreciated.
Here is the code I used:
public class CanvasProxy extends AnxaCanvas{
private static CanvasProxy canvas;
public static CanvasProxy getInstance(){
if (canvas == null)
canvas = new CanvasProxy();
return canvas;
}
protected AnxaCanvas current;
private CanvasProxy(/*AnxaMIDlet midlet*/){
/*this.midlet = midlet;
passMIDlet(midlet);*/
}
public void setScreen(AnxaCanvas canvas){
if (this.current != null)
this.current.hideNotify();
this.current = canvas;
this.current.showNotify();
System.out.println("1");
repaint();
System.out.println("2");
midlet.display.setCurrent(this.current);
}
public void keyPressed(int keyCode){
if (current != null)
current.keyPressed(keyCode);
repaint();
}
public void paint(Graphics g){
System.out.println("proxy paint");
if (this.current != null)
this.current.paint(g);
}
}