开发者

How to implement two UI threads LWUIT in Blackberry?

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜