How to call a second screen?

I don't know exactly how to call a second display (displays the results of a web service) with some parameters.  I'm starting simple and sending the GPS coordinates of the current location.  I would like to call the service, and then view the name of the first result in the text field.  However, I get the infamous with is not the mistake of blocking event every time that I try to do the setText.  Can someone tell me what I'm doing wrong here?

class Results extends UiApplication {    public static void main(String[] args) {        Results gbResults = new Results(args[1], args[2]);

        gbResults.enterEventDispatcher();    }

   private Results(String Latitude, String Longitude) {        pushScreen(new ResultsScreen(Latitude, Longitude));    }}

final class ResultsScreen extends MainScreen{

    ResultsScreen(final String Latitude, final String Longitude) {        final LabelField lblResult = new LabelField("Result:", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);        add(lblResult);

        UiApplication.getApplication().invokeLater(new Runnable() {            public void run() {                //Call the service and get back [wsresult]                synchronized(UiApplication.getEventLock()) {                    lblResult.setText("Result: " + [wsresult]);                }            }        });    }}

Now, I don't think that I need this class first results statement as in my first screen I call you just this screen like this:

getUiEngine().pushScreen(new ResultsScreen(String.valueOf(qc.getLatitude()),String.valueOf(qc.getLongitude())));

I think I'm calling and declaring the second screen correctly that the code is certainly get there.  There is just something to do with this setText.  What I need to do kind of the enterEventDispatcher () inside the ResultsScreen class?

Also, I tried to do just the invokeLater by itself and the synchronize (getEventLock) by itself and kept getting the error each time.  It seems that no matter what I do, it always says that I'm not holding the lock on the event.

I realized what the problem was.  When I called the getUIengine (.pushScreen), I was outside the event thread and so I had to wrap this call in a getAppLock as well.  When I was debugging before she looked like she came all the way to the setText (I'm sure that was the case somehow) and then wrong so I don't think that the appeal was the cause of the problem.

Tags: BlackBerry Developers

Similar Questions

  • How to call a second instance of the same VI?

    Hello

    I have a useful VI dealing with IO operations. To save some time, of what I would call the VI as a second instance do work at the same time. I created a sequence sub with the run option 'Use the new thread' and I called the Vi (a step of the sequence only). Execution time of the VI is about 20 seconds run Durin I called the subsequence and I carried on running my main sequence (parent). Since then 10 seconds to launch the subsequence (in the thread of sepatate I called the same VI as in the thought of subsequence the second instance will be created. However, instead of parallel work of the two instances of the same VI had to wait when mt subsequence end known call the VI th.

    So my question is, as in the topic: how to call a second instance of the VI even at the "same time"?

    Could you please tell me about the best approach to solve the problem?

    Any VI that you want to run in parallel must be paid also re-entrant, including screws.

  • How to push the second screen?

    Hello

    I am writing an application in which I'm trying to push a second display to a custom in the first menu item. The first screen is pushed successfully and the custom menu items are filled with a bluetoothserialportlistener. Once I click on a special menu item, I want to launch the second screen. I used a dialog.alert to verify that the the menuitem run() method works, but the second screen is not displayed.

    Any suggestions are greatly appreciated!

    The first screen is created by hand (String [] args)

    MatMain app = new MatMain();

    app.enterEventDispatcher ();

    private MatMain() {}

    pushScreen (new WelcomeScreen());

    }

    I tried to call the second screen as follows:

    synchronized (UiApplication.getEventLock ()) {

    getUiEngine () .pushScreen (new MatOnline (_info));

    }

    I also tried:

    UiApplication.getUiApplication () .pushScreen (new MatOnline (_info));

    Thanks again!

    Hello

    I think you're trying in a very complex way.

    Your architecture using complex and ignoring the bluetooth codes related, I can see your second screen with a minor modification.

    In your DeviceMenuItem class.

    replaced

    MatMain.getUiApplication () .pushScreen (new MatOnline (_info));

    with

    UiApplication.getUiApplication () .pushScreen (new MatOnline (_info));

    And in your class MatOnline:

    replaced

    HorizontalFieldManager _fieldManagerOnline;
    with

    HorizontalFieldManager _fieldManagerOnline = new HorizontalFieldManager();

    Concerning

    Bika

  • How to detect a second screen for a virtual machine (Window 7 or 8)

    I would not not to ask if virtual machines (for example, Window 7 or 8) in VMware Fusion can dectet a second display and use it. I use Window 8 of a VM to extend the display to another. Although the configuration looks ok, the second screen see nothing second screen of 8 on the window of this virtual machine (virtual machine is in full screen mode)

    The second screen of the Macbook works well.

    Help anyone?

    See you soon,.

    Anthony

    Have you tried:

    View-> use all displays in full-screen.

  • CTRL-Alt-2 moves to the second screen windows - how to disable

    Hello

    I have a new computer to dual screen in Windows 8.  When I do Ctrl + Alt + 2, my current window is moved to the screen 2 (and equivalent to 1).  Does anyone know if it is a shortcut of Windows 8 or another utility?  I have a nVidia graphics card and the 7200LE Panel is not shortcut (besides the stereoscopic 3D features that are disabled).

    The problem is that Windows seems to treat the key ALT GR (right Alt key for the keyboard layout of the French-Canada) as a combination of Ctrl + Alt, then when I press Alt Gr + 2 to type the symbol @, my window also moves to the second screen.  The equivalent problem is when I type the ± symbol (AltGr + 1 gives my character, and move the window), but this isn't as big a problem.

    Anyway, if anyone knows how to disable the Ctrl + Alt + 2 sets of shortcuts, or how to make windows treat differently the keys Ctrl + Alt, AltGr do let me know.

    Thank you
    IM

    I had the same problem, and in my case it was a third-party application that came with a USB to DVI adapter.

    The utility is called "MCTDUtil.exe" and is in "\Program Files".

    It has a visible icon called "Super Utility".  There, you have a menu called "Multi Display Control Panel".  The Ctrl-Alt-1 and Ctrl-Alt-2 are mapped to do exactly this: move the window being displayed 1 and 2 respectively.  You can disable the feature of this Panel.

    I suspect that this utility is not necessary and can be removed.

  • How to factory reset an imac using the second screen

    How to factory reset or restore my system using a second screen


  • How to get the film on the second screen and cut on normal?

    How to get the film on the second screen and cut on normal?

    iMovie 10 does not support using double screen, tou need to FCP to do.

    Geoff.

  • Liquid Z 3 How to use the small screen-receving-phone-call?

    Hello

    I would like to know how to use the small screen that appear in a case to receive a phone call.

    There are two types of screen wen we receive a phone call. I know how to use a larger. But not for the little ones. Aid for the small indicates that we have to drag the green phone symbol that I guess, but to fall on what? The manual doesn't explain it at all, it is not obvious!

    Thank you very much for your help!

    With "appellant float" activated, simply to press the Red or green button, no need to call, if the "small screen" is that of the attachment

  • How can I make my second screen a monitor? New versions wiped my preferences and do help with no help.

    I am trying to use my second screen as a monitor size for editing. All my old layouts have been lost in systems and subsequent updates. It was a simple task made now lost in the options. How to do this task once simple?

    @

    Edit/Preferences... this tab:

    Neil

  • opening of Skype call causes blue screen

    ORIGINAL TITLE: Urgent... Help, please... Blue screen

    When I'm about to open Skype call my laptop screen always turn blue, then I downloaded view blue screen then he told me that my driver is broken and he is ntoskrnl.exe, how can solve this problem the bluescreen on always keep coming and then restart. He said something as preparation to dump...

    Help, please. because I just brought this computer... Please help... How can fix the ntoskrnl.exe driver?

    Hello

    Check with the help of Skype and their forums, as it may be known issues.

    Skype - Support
    https://support.Skype.com/en-us/

    Skype - Forums
    http://Forum.Skype.com/

    ------------------------------------------------------------------------------------------------------------------------------

    Ntoskrnl.exe is a component of Windows which means than anything else he has led astray. More likely
    the root cause on top of my head are the WiFi (wireless) or network (wired) NIC drivers. Check with
    system manufacturer (manufacturer of motherboard for customized systems) or the actual manufacturers. (See
    driver update methods below.)
     
    ----------------------------------------------------------

    Pick up the pieces after a computer crash
    http://Windows.Microsoft.com/en-us/Windows-Vista/picking-up-the-pieces-after-a-computer-crash

    Check this thread for more information using BlueScreenView, MyEventViewer and other methods
    to troubleshoot the BlueScreens - top 3 responses (+ 1 other).

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-system/blue-screen-plug-and-play-detected-an-error-most/3deab2fa-4000-4136-8c78-a3d22b1db009

    We can analyze the minidumps if make you it available to the SkyDrive or another file
    sharing sites (such as MediaFire). If you have problems to download the copy of minidumps
    for the office or in the Documents folder and download them from there.

    ZIP or download the content of the C:\Windows\minidump

    Use SkyDrive to upload collected files
    http://social.technet.Microsoft.com/forums/en-us/w7itproui/thread/4fc10639-02dB-4665-993a-08d865088d65

    -------------------------------------------------------------------------

    Also this, so you can see the probable bluescreens.

    Windows Vista restarts automatically if your computer encounters an error that requires him to plant.
    (also Windows 7)
    http://www.winvistatips.com/disable-automatic-restart-T84.html

    ===========================================================

    Check out these utilities to see if information may be collected:

    It is an excellent tool for displaying the blue screen error information

    -Free - BlueScreenView scans all your minidump files created during 'blue screen of death '.
    hangs and displays information about all accidents of a table.
    http://www.NirSoft.NET/utils/blue_screen_view.html

    -------------

    MyEventViewer can be verified at the time of the blue screen (BSOD) for a second or less
    the time of the BSOD for more information on the possible cause - see TIP.

    MyEventViewer - free - a simple alternative in the standard Windows Event Viewer.
    TIP - Options - Advanced filter allows you to see a period of time instead of the whole of the record-
    Set it for a bit before and after the time of the BSOD.
    http://www.NirSoft.NET/utils/my_event_viewer.html

    ------------

    AppCrashView - free - a small utility for Windows Vista and Windows 7 which shows details
    application of all accidents occurred in your system. The information breaks down is extracted from
    the wer files created by the Windows Error Reporting (WER) of the operating system component
    whenever an accident occurred. AppCrashView also allows you to easily record the list of accidents
    text/html/csv/xml file.
    http://www.NirSoft.NET/utils/app_crash_view.html

    ========================================================================

    Control Panel - network - write down of the brand and the model of the Wifi - double click top - tab of the driver - write
    version - click the driver update (cannot do something that MS is far behind the pilots of certification). Then
    Right click on the Wifi device and UNINSTALL - Reboot - it will refresh the driver stack.

    Look at the sites of the manufacturer for drivers - and the manufacturer of the device manually.
    http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htm

    How to install a device driver in Vista Device Manager
    http://www.Vistax64.com/tutorials/193584-Device-Manager-install-driver.html

    Download - SAVE - go where you put it - right click – RUN AS ADMIN.

    You can download several at once however restart after the installation of each of them.

    After watching the system manufacturer, you can check the manufacturer of the device an even newer version. (The
    manufacturer of system become your backup policies).

    Repeat for network (NIC) card and is a good time to get the other updated drivers as Vista like
    updated drivers.

    I would also turn off auto update for the drivers. If the updates Windows suggests a just HIDE as they
    are almost always old, and you can search drivers manually as needed.

    How to disable automatic driver Installation in Windows Vista - drivers
    http://www.AddictiveTips.com/Windows-Tips/how-to-disable-automatic-driver-installation-in-Windows-Vista/
    http://TechNet.Microsoft.com/en-us/library/cc730606 (WS.10) .aspx

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • MacBook Pro recovery, second screen goes blue

    I have connected a second monitor via HDMI to my Macbook Pro, but when the Mac goes to sleep after having no use, the second screen will able. How can I make a screen saver is on the second screen. The screens are not mirrored. The law as one long screen. Thanks for the tips

    Hello SaadSydney,

    These are the facts as I understood your message:

    -You have a MacBook Pro that you use in conjunction with an external monitor which allows you to extend your Mac display.

    -However, when you put your Mac to sleep, the external screen goes blue.

    -Instead of your external monitor turning blue, you want it display a screen saver.

    It is important to note that any screen connected to your Mac screen may not show a screensaver mode 'sleep'. I don't know if your external monitor itself allows you to choose a screen saver and let it run while your MacBook is asleep, but otherwise, there is no inherent solution corresponding to your query in OSX El Capitan. Perhaps that is the reason why your external screen goes blue when your Mac goes to sleep - it is always plugged, but we can think that there is an error or something similar allowing him to view any content, even if it is plugged.

    If your MacBook itself displays a screen saver, but not in mode ensures your external display also displays this screen saver.

    Hope you understand,

    -RamalTheCamel

  • How can I connect two screens for MacBook Air (mid-2012)

    I have a macbook air (mid-2012) which, according to apple, can support two external displays.  I have an external display connected to the thunderbolt port, but may not know how to connect to the other?  The mac has only a thunderbolt port?  It has two usb ports.  Is there a thunderbolt display port separator that works with this Apple?  When I look on amazon I see some who make the separation, but they say that they do not work with the Mac?  Any recommendations would be greatly appreciated.  Thank you in advance!

    You can daisy chain a thunderbolt cable from the first screen to a second screen to support both with port of a sudden lightning. Reported here.

  • How can I download a screen shot to the page in question?

    How can I download a screen shot to the page in question?

    You can't attach an image to the first post which creates a thread. You need to add another post (second) to fix an image.

  • The button on my lockscreen does not work on my phone. Recently, my screen went completely black. I can turn on siri. How can I get my screen to turn back?

    My 5 IPhone lockscreen button does not work so I use touch help to the screen power off and screenshot. As I was using my phone my screen went completely black. I tried to plug it into a charger and call but the screen still won't turn. My phone vibrates when I call and I can't turn on siri. I tried to search the Internet on how to re-enable it. Everything I've seen involves using the screen lock button but obviously I can not use it. How do I reactivate it?

    Hello tumbler3100,

    Thank you for using communities Support from Apple!

    I understand that your iPhone screen is returned while you were using it and the on/standby button does more either. Because your iPhone is always vibrate when you call and you are able to use Siri, it seems there is a problem with the backlight on your iPhone.

    Because you have a separate hardware two related issues going on with your iPhone, I suggest putting your iPhone in an Apple Retail Store or Apple authorized service for an assessment of your device provider. More information about these options can be found in the following link.

    Apple - Support - Service Response Center

    See you soon!

  • Satellite M30X-129 - no video on the second screen

    I have a M30X-129, which for the most part works fine. However, when I have a second monitor attached (for example, an overhead projector) everything is displayed outside a video/film clip, which appears black. This occurs if Windows Media Player or Realplayer is used. All other programs and images are visible on the external monitor or laptop screen.

    I installed Windows XP Pro on the orig XP Home version. All drivers were installed and updated as required. I thnk I have a Raedon graphics card.
    Any ideas on how to have movies/clips on the second screen?

    Thank you.

    Hello

    Most Windows applications and video cards do not support playback of video files on the screens at the same time. You can try to disable the video signal going to the built in LCD screen and display only through the projector.

Maybe you are looking for

  • HP Officejet J3680 all-in-One: Officejet J3680 will install no software for Windows 10

    The complete software for the J3680 will not install on my new Acer Windows 10 PC (6 months). I don't have the codes error, but when undo them the installation process continues from referring to Windows 8 and I made sure that the software that I cho

  • Upgrade memory on Satellite Pro A10

    Can anyone advise me on the correct type of RAM to upgrade my Satellite Pro A10. Its a standard of 256 MB at the minute and I think to mortise in additional 512 MB next to her - but I am confused by the array of the types of memories and classificati

  • Bug: birthdays synced from Exchange are 1 day off [de-version]

    Hi guys,. I have a pretty annoying bug here. Location: Defy bought in Germany with all the German settings (UTC + 1). I have contacts in Exchange sync on the Defy that contain birthdays (and other events). I also have contacts with birthdyas coming f

  • (plugged in, load) but the battery is not charging

    Hello! I have a problem with my hp laptop Pavilion dv6 - 2190ev. The laptop cannot start if the charger is connected only (and the battery). It will only start if the battery is on. Also, the led and the laptop displays: (plugged in, load) but the ba

  • HP Simplepass inop

    I have a HP Pavilion dv7 notebook is a little more than a year. I can't open HP Simplepass. the program works with my fingerprint, but I can't make the changes or updates because the program does not open. I can't store all new Web sites either. help