How can I know or be notified when a call for Display.setCurrent take effact?
How can I know or be notified when a call for Display.setCurrent take effact?
In a Canvas subclass, you can override hideNotify ad showNotify.
Displayable itself only has an isShown method.
If you want to get complicated, you can use an invisible Canvas as a gatekeeper. See AlertRouter in this article by Eric Giguere:
http://wireless.java.sun.com/midp/ttips/multialerts/
Many thnaks for your answer.
The problem is that I use Forms and Lists and not Canvas.
Any suggestions for Forms?
I use Display.callSerially(Runnable r)
It calls your code "soon after completion of the repaint cycle".
In particular right after showing your Form or List.