Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Multithreading 如何在Blackberry中实现两个UI线程Lwiit?_Multithreading_User Interface_Blackberry_Lwuit - Fatal编程技术网

Multithreading 如何在Blackberry中实现两个UI线程Lwiit?

Multithreading 如何在Blackberry中实现两个UI线程Lwiit?,multithreading,user-interface,blackberry,lwuit,Multithreading,User Interface,Blackberry,Lwuit,我正在使用LWUIT为blackberry编写一个应用程序。我想在先前打开的窗口中执行流程时显示一个弹出窗口。我该怎么做 提前感谢,, Sajith Weerakoon。您不能有两个UI线程,但是可以在使用新线程(x.start())创建的单独线程上进行后台处理; 要与UI线程同步,可以使用CallSerialy/CallSerialy和Wait,例如: new Thread() { public void run() { // do whatever lwuit cal

我正在使用LWUIT为blackberry编写一个应用程序。我想在先前打开的窗口中执行流程时显示一个弹出窗口。我该怎么做

提前感谢,,
Sajith Weerakoon。

您不能有两个UI线程,但是可以在使用新线程(x.start())创建的单独线程上进行后台处理; 要与UI线程同步,可以使用CallSerialy/CallSerialy和Wait,例如:

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

这应该是完全可能的。你的问题标题是:你不想要2个UI线程,而是在后台有一个单独的线程。您可以根据需要简单地更新表单和对话框。我看不出这有什么问题。