1

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.

  • this should be completely possible. Your question title is miss leading you don't want 2 UI thread but rather a separate thread in the background. You would simmply update both the form and the dialog as needed. I see no issues with this. – drubin Jan 25 '11 at 22:33

1 Answers1

2

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();
Shai Almog
  • 51,749
  • 5
  • 35
  • 65