I am writing an application for 开发者_如何学编程blackberry using LWUIT. I want to display a popup window while a process is carried out in the window which is previously opened up. How can I do this?
Thanks in advance, Sajith Weerakoon.
You can't have two UI threads, however you can do background processing on a separate thread created using new Thread(x).start(); To synchronize back with the UI thread you can use callSerially/callSeriallyAndWait e.g.:
new Thread() {
public void run() {
// do whatever lwuit calls
Display.getInstance().callSeriallyAndWait(new Runnable() {
public void run() {
// this will happen on the LWUIT thread, you can do whatever
}
});
// continue doing whatever
}
}.start();
精彩评论