I have developed a game but this is a serious problem I am facing. I don’t have any threads in my code , but whenever I use alert
Display.setCurrent(my_alert)// my_alert has a timeout of 3000ms
then after this alert, a blank white screen appears.When the screen is pressed, then my game canvas reappears. Before setting alert, my game canvas of checkers board is set as the current display. This problems also appears after the automatic keypad lock.
This alert is vital for my game, Kindly suggest a solution.
Issues like that typically indicate missing or incorrect override of GameCanvas method showNotify():
Above method is invoked at return from Alert to prior screen. GameCanvas should somehow trigger repaint of the the screen (eg using
repaintorflushGraphicsmethods), otherwise it will be displayed blank.The fact that this problems also appears after the automatic keypad lock makes it even more likely that
showNotifyis not done right in your MIDlet.