Menu remains visible after you make the selection, and does not show Popupscreen

Hey. Unable to get a (a gaugefield) on a Popupscreen progress bar to show. It is called from a menu. The user clicks a menu item, and a method is called. The method among other pushes a Popupscreen containing a Gaugefield on display battery-code below. Then, he starts a thread which downloads an image and using join() to wait for it complete (long story). Then, in the thread of events, it appears the Popupscreen.

The menu does not disappear when you click on it in the Simulator (JDE 4.7, the Bold 9700 sim), but the download happens. Once the download is complete, the menu disappears, the Popupscreen is shown and he tried to pop() Popupscreen, causing an IllegalArgumentException.

I tried to split the method into two methods, the download happened in the 2nd method, because I read the forum search that the UIEngine don't update the display until the method finishes (it runs in the event thread). But it made no difference...

How can I get this menu to disappear immediately and the push (popup) to work?

See you soon!

Justin.

                        progressbar = new GaugeField("", 0, 100, 50, GaugeField.NO_TEXT);
                        progress = new PopupScreen(new FlowFieldManager()) { protected void OnDisplay() { super.onDisplay(); /*cancelButton.setFocus();*/  }  };
                        globalTiles.pushScreen(progress);

                        progress.add(new LabelField("Downloading (rest of) picture ..."));
                        progress.add(progressbar);
                        progress.setFocus();

                        if (!threadbg.isAlive()) {
                                   threadbg = new ThreadForBgDownload();
                                   threadbg.start();
                        }
                        else {
                                   // Show the progress bar, mostly complete (it is running and was in the bg). Game will start after last bit done
                        }

                        threadbg.join(); // Wait for download thread to complete and 'die'

                        globalTiles.popScreen(progress);

Rule #1: all display updates should occur on the thread event or synchronized on the lock of the event.

Rule #2: the thread of events (or now the lock of the event) should never be blocked by lengthy operations.

The scenario you sketched out is usually handled like this: menu item run() method don't whatever immediate user interface updates are necessary and starts a worker thread. It does not wait until the thread ends before returning. (If so, updates the user interface include pushing a "Please wait" or progress pop up). The worker, at the same time, begins to do its stuff. When it's time to update the user interface (either because the task is completed or to view progress) the worker thread usually called invokeLater (Runnable) (a method in the Application class) where the executable run() method updates the user interface. If the worker thread must receive user input in his work, he can use invokeAndWait (Runnable), where the executable not all interactions of the user and stores the user entry somewhere so that the worker thread can grab after invokeAndWait() returns.

Although the synchronization on event lock works perfectly well, it is more common for some reason any to invoke a Runnable, perhaps because the latter clearly encapsulates in a separate object the work to be done on the event thread.

The above policy is the basis of the excellent Peter Strange example I linked to before.

Tags: BlackBerry Developers

Similar Questions

  • I can't not persistent install the latest update of Adobe Audition. It is not a CC version but came on disc in CS6. I constantly get this error message after you download the update that does not install: U43M1D207. What are the steps to complete t

    I can't not persistent install the latest update of Adobe Audition. It is not a CC version but came on disc in CS6. I constantly get this error message after you download the update that does not install: U43M1D207. What are the steps to perform this installation?

    Adobe Audition: For Macintosh

  • Madam, Sir, since the last update my gmail is weird. It always shows my Inbox properly but if I open a message, shows adwords at the back of the net and does not show the message that the name header and the reply button on the right side of the message.

    It does not have this in Internet Explorer

    Wow, thanks! Who did the trick! (I mean subscriptions in Adblock Plus updated preferences).

  • Initially, I downloaded the application and was able to access all my photos by album, photostream, fb, etc.. Now, it will not go all. After you remove the application and try to download it, it says that I have to pay for it (yet) any help would be

    Initially, I downloaded the application and was able to access all my photos by album, photostream, fb, etc.. Now, it will not go all. After you remove the application and try to download it, it says that I have to pay for it (yet) any help would be appreciated.

    Sounds like a question of verification on any market that you have bought PS Touch. Have you tried contacting Google and Apple to see what they say?

  • Sliders on my muse adobe site are visible when I discovered the site in the browser within the program, but does not show up on published site

    Sliders on my muse adobe site are visible when I discovered the site in the browser within the program, but does not show up on the published site.

    explorersglobalfineart.com

    How can I rectify this?

    Thank you

    A large number of files in your site seems not to be on the server. If you use file > upload to FTP host, please repeat the process and select Download all files. If you use file > export as HTML and download with an FTP external program, please repeat the export process in an EMPTY FOLDER and then download everything that has been exported to your server.

  • I've installed Illustrator dnuee and uninstalled and reinstalled, it bounces just off the dock and does not open (should I uninstall CS5) thank you

    I've installed Illustrator dnuee and uninstalled and reinstalled, it bounces just off the dock and does not open (should I uninstall CS5) thank you

    Hello Leana,

    Can you please try to open Illustrator after creating a new user account on your computer?

    It could be a permissions problem, I just want to check that first.

    Thank you best regards &,.

    Rambour

  • Problem with the Organizer - it does not show changes to ACR

    When I open JPEG files in ACR, apply the changes (for example, Saturation - 100), click done, and then to open these files in the Organizer - it does not show changes in the cab so that I can't use an option File/Export as a new file. When I click on this file in the Organizer menu and open again in the editor, the image opens in ACR (not Photoshop editor) with changes


    In the example below you can see that in the Organizer in metadata / Camera Raw/Saturation (in Polish "my") = - 100, but does not show the image in black and white. I do something wrong? Help, please.


    organizer-problem.PNG

    In short, the changes you make in ACR are saved in the section of metadata of jpeg files when you click on "Done" you demonstrated.

    You are right, the thumbnails are not updated in the Organizer, and changes are not taken into account when the export of the Organizer (unlike what I thought).

    When you reopen the file of the editor or organizer, it is automatically opens again in the ACR dialog box and leaves you the choice of the original version, the default value 'auto', ACR, your 'custom' corrections correction or corrections of the already modified the file. That's fine when you modify or re - edit files individually, but this isn't the solution for the process of 'batch' as an export or by applying the same correction to a batch of files.

    My suggestion is to use a workflow that I tested recently.

    Let's say you have a batch of 20 files JPEG editing in ACR.

    -You can open them all in the cab to the command "open in camera raw" Editor.

    -You can leave the default conversion of ACR or add other corrections to some of the files.

    -to highlight all the files in the film strip and click 'done '.

    -You use the 'save' button to convert to DNG with the options you want. (I choose to create in the same location)

    As a result:

    -your files JPEG is unchanged, no thumbnail is updated, the corrections are ignored in the export process as described above.

    -You can import the DNG of their location (with a record of 'control' can help).

    -the DNG is displayed with thumbnails updated

    -they can be exported as you want

    -You can see JPEG and DNG files

    -You can even ignore the original JPEG (the DNG format keeps intact with a reasonable increase in file size).

    -If you want a redundant storage, we can use the function 'automatically suggest photo stacks' for battery original JPEG and DNG.

    If it works for you?

  • When I turn on the computer, it does not show my office. It comes up with a white screen

    Original title: bad start.

    On May 15, 2013, I was prompted to download 8 updates from Microsoft. Since then when I turn on the computer, it does not show my office. It comes with a white screen. The only way to see the desktop is at the stop 'wrong' to turn off the power to the computer. Then I reboot, it just asking if I want to boot up normally, I say Yes and all is well on the office. Seems related to downloads of May 15, 2013. Any ideas?

    Hello

    Method 1:

    I suggest you to select last known good Configuration in Windows Advanced options and check if it works.

    To do this:

    a. restart the computer and press the F8 key for about four to five times.

    b. you will see the that last known good Configuration in the Advanced Windows options.

    c. Select last known good Configuration and press enter.

    Method 2:

    See the article and check if that helps:

    What to do if Windows does not start correctly

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-to-do-if-Windows-wont-start-correctly

    For more protection, use System Restore backup and restore, which is designed to help save email, photos, documents and other personal files.

    Note: when checking your drive hard for errors, if bad sectors are found, it tries to repair this sector and if all the available data may be lost.

    Let us know if it helps.

  • update date and time for 3.6 numbers does not show the time and does not automatically update the date

    The 'update date and time"for numbers of 3.6 does not show the time and does not automatically update the date.  What should I do?  Thank you.

    Hi david,

    where do you find ' update of the date and time.

    Quinn

  • buy an iphone 5s by amazon and I came with iCloud blocked an account... {I called the seller and does not that I do that I'm from Venezuela please need your help}

    buy an iphone 5s by amazon and I came with iCloud blocked an account... I called the seller and does not that I do that I'm from Venezuela please need your help

    No one here can help you. The device is locked activation. Since you have made the purchase by Amazon, you can check with them to see if they will stand behind it. No one on the forum, or Apple can help you remove the lock. Only the previous owner can do this. I suggest that you demand a refund, so let's start a claim with Amazon about this dealer.

  • Trash hangs on "Preparing to empty the trash" and does not empty

    When I try to empty my trash, it hangs on "Preparing to empty the trash" and does not empty.

    Look here for possible solutions:

    https://support.Apple.com/en-us/HT201583

    http://www.thexlab.com/FAQs/trash.html

    Ciao.

  • When I try to view my devices to Control Panel/hardware and Sound/devices and printers, he treats forever and does not show the devices.

    When I try to view my devices to Control Panel/hardware and Sound/devices and printers.  It treats forever and does not show the devices.  I need help!


    Original title: device and Printers window
    There could be various reasons why the window devices and printers stalls. All the control points are listed here.
  • Error when you try to add a song to Windows Movie Maker: the selected file is not valid or is corrupted.

    Sometimes, when I add a song to Windows Movie Maker it does not work.

    When I try to add one of my songs, it is said: C:\Documents and Settings\Utilisateur\Mes documents\Ma Musique\iTunes\iTunes Media\Music\Craig Smart\I Miss You - Craig Smart.mp3 could not be imported. The selected file is not valid or is corrupted.

    Help, please

    When I try to add one of my songs, it is said: C:\Documents and Settings\Utilisateur\Mes documents\Ma Musique\iTunes\iTunes Media\Music\Craig Smart\I Miss You - Craig Smart.mp3 could not be imported. The selected file is not valid or is corrupted.

    Help, please

    2 responses on itunes and Windows Media Player (WMP) are:

    1.

    RE: iTunes and WMP - MusicBridge

    Found this on the web. I can't vouch for it. Use it at your own risk.

    Excerpt:
    iTunes is not compatible with Windows Media Player. iTunes is - like Apple-very protective of any product and does not like to share. So, you have to force off iTunes and WMP.

    To do this, you can use this sloppy program: MusicBridge.
    The description of its creator:
    MusicBridge allows people who use both iTunes and WMP on the same machine to keep their libraries in sync. MusicBridge offers a variety of synchronization options so that you can manage your collection of music in the media player, or both. MusicBridge duplicates of meta-data between Windows Media Player and iTunes, it does not copy the physical files between applications.

    Version 2.0.1 is a bug fixing release.

    Best thing: it's free.
    http://download.CNET.com/MusicBridge/3000-2141_4-10530687.HTML?tag=mncol;psum

    2.

    courtesy of musiclover101:
    convert the songs in your iTunes library to a format that Windows Media Player can understand

    You can convert the songs in your iTunes library to a format of Windows Media Player can understand - (I tend to use mp3). This can be done inside of iTunes itself. If the songs in your iTunes library were purchased in the iStore and were purchased in the plus version (indicated by a small sign above the price of a song +), then they are DRM free, so they can be converted easily. However, if the songs were not purchased in the format more, you can convert them for 30 cents each. I highly recommend that you do as the plus version of songs are premium quality - and since they are DRM free, you can use them in almost all applications and you can burn them to CD and play almost anywhere. All the songs on the iTunes store are now version more, so you don't have to worry about searching for them in the future.
    To convert songs to Windows Media Player can understand, open iTunes, and then do the following:
    1. click Edit, preferences, and go to the general tab
    2. click on the button "import settings".
    3. change the "import using" at "MP3 encoder".
    4. click OK and go back to your music library
    5. choose the list view and select the first piece of your library
    6. scroll all the way to the last song in your library
    7. press the button SHIFT key, then click the last song to select all the songs in your library
    8. click on "Advanced" and then "Create MP3 Version."
    9. your songs should start to convert and according to how many songs do you have in your library, this could take some time
    10. open Windows Media Player and press F3 or click file, add it to the library

    11. click on OK - Windows Media Player should start to search for songs on your computer and after that he finished the search, you should find the songs in your library in your Windows Media Player to iTunes library.

    NOTE: This method will not work unless you have purchased iTunes songs or if you have converted the songs iTunes more for each 30 c

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • arrow of the selection list does not work

    Run version 4.2 against database 11g.

    On one of my pages none of my page selection point lists are working properly.  When clicking on the arrow at the end of the selection in the list list does not open, but if you click within the field where the text is displayed, it will open.  I tried IE and Firefox and the result is the same on both browsers.  If anyone has seen this behavior before?

    After putting a few more space between list boxes, the problem solved.  I guess even if visually there is space between them, it was somehow a kind of overlap.

  • After you install SP2, my wifi does not work.

    Hello

    Since the installation of SP2 on my Dell XPS 1530 I can no longer connect to or even 'see' wireless networks, according to the Manager of wireless devices driver is the latest version, however the Device Manager does not seem to recognize when I manually disable the adapter wireless via the hardware switch.  When I try to connect to a wireless network, the list of available networks is empty, before installing SP2, I could see about 6 different networks within my apartment complex.

    When I click on "diagnose why windows cannot find any additional network" tells me "the NIC"Intel (r) Wireless WiFi link 4965AGN"knows driver or hardware related issues.

    According to the "State of the wireless network connection" my computer receives packets wirelessley, when I turn off the adapter via the hardware switch that stops and then restarts when I turn it back on.  IPv4 and IPv6 connectivity show: not connected.

    When I switch to the command line and type ipconfig the wireless adapter is not listed, only bluetooth and ethernet properties are displayed.

    Can someone suggest possible solutions to this problem?  I tried to uninstall SP2 that made no difference.  Unfortuantly there isn't a restore point saved before installing SP2 first, then it is not an option.

    Thank you

    Chris

    Thanks for the info.

    Ultimately I cheated and used the opportunity for a bit of spring cleaning, I so re formatted my hard drive and did a fresh install of Vista.  All problems solved so far.

    Thank you

    Chris

Maybe you are looking for