java - J2ME lcdui: Can I manipulate my GUI in a worker thread? -
I'm just starting with J2ME and LCDUI, and I'm looking at some sample code that says LCDI objects Calls from a worker thread
In my experience with desktop GUI toolkits, it is generally forbidden - is LCDIE different? Is it really okay to do this?
(I have made the goal to answer this question, but nothing got done - in some official documents a link to a disputed answer would be excellent!)
Lcdi is a strange thing, which you can and can not often depend on implementation. I have written an application for Blackberry, that there is no problem reaching the UI object from the background thread (except for common threading problems which you create yourself), but I am pretty sure that some other platforms will stop it.
If you are concerned about this, or it is causing problems to you, then you want to use javax.microedition.lcdui.Display.callSerially (Runnable)
. This executes the runable
object given in the UI thread (if there is such a thing in LCDU) and serializes it with other UI events and paint operations. You can read more about this.
Comments
Post a Comment