开发者

How to implement two UI threads LWUIT in Blackberry?

开发者 https://www.devze.com 2023-02-06 20:27 出处:网络
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?

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

精彩评论

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

关注公众号