Screen 120 Hz when the Thread runs

I have a screen with a menu if I use an option it reads data from a trip from a page php how to stop running until the data is read and refresh the screen

my menu

private final MenuItem leerDatos = new MenuItem("Viajes del Chofer ",
                                0, 0) {

                        public void run() {
                                ElRecreo.URLChofer = "http://coopelrecreo.com/choferes/CedulaViajes.php?campo=cedula&buscar="
                                                + ElRecreo.CedulaChofer;
                                MyThreadRead thread = new MyThreadRead();
                                thread.start();
                               /*
                               if (ElRecreo.isRunning==false){
                                EditField _viajes = new EditField("" , ElRecreo.URLresult, Integer.MAX_VALUE, Field.EDITABLE);
                                add(_viajes);
                                invalidate();
                            }*/
                        }
                };

And it's the wire

private class MyThreadRead extends Thread {
                        public void run() {

                                ElRecreo.isRunning=true;
                                String _Url = "http://coopelrecreo.com/choferes/CedulaViajes.php?campo=cedula&buscar="+ElRecreo.URLChofer;
                                String _UrlBuscar="";
                                try {

                                        if (ElRecreo.srWAP2 != null && ElRecreo.coverageWAP2) {
                                                baseURL = _Url;
                                                _UrlBuscar = getWAP2URL();
                                        }
                                        if (ElRecreo.srWiFi != null && ElRecreo.coverageWiFi) {
                                         baseURL = _Url;
                                         _UrlBuscar  = getWifiUrl();
                                        }
                                      //  StringBuffer sb = new StringBuffer(_UrlBuscar);
                    //    while isRunning{
                        HttpConnection connection = (HttpConnection) Connector.open(_UrlBuscar,Connector.READ_WRITE, true);
                        InputStream inputStream = connection.openInputStream();
                        byte[] responseData = new byte[10000];
                        int length = 0;
                        StringBuffer rawResponse = new StringBuffer();
                        while (-1 != (length = inputStream.read(responseData))) {
                                rawResponse.append(new String(responseData, 0, length));
                        }
                        int responseCode = connection.getResponseCode();
                        if (responseCode != HttpConnection.HTTP_OK) {
                                throw new IOException("Codigo invalido:" + responseCode);

                        }
                        String result = rawResponse.toString();
                        ElRecreo.URLresult = result;
                        Dialog.alert(ElRecreo.URLresult);
                        ElRecreo.isRunning=false;
                         /*
                         add(new SeparatorField());
 EditField viajes = new EditField("" , ElRecreo.URLresult.toString(), Integer.MAX_VALUE, Field.EDITABLE);
 add(viajes);
 invalidate();
/*
                                        /*
                                         connection = (HttpConnection) Connector
                                                        .open(_UrlBuscar);
                                        System.err.println(_UrlBuscar);
                                        InputStream input = connection.openInputStream();
                                        DataBuffer buffer = new DataBuffer();
                                        byte[] temp = new byte[1024];
                                        for (;;) {
                                                int bytesRead = input.read(temp);
                                                if (bytesRead == -1) {
                                                        break;
                                                }
                                                buffer.write(temp, 0, bytesRead);
                                        }
                                        input.close();
                                        connection.close();
                                        ElRecreo.URLresult = buffer.toString();
                                        System.err.println(ElRecreo.URLresult);
                                        System.err.println(ElRecreo.URLresult.toString());
                                        ByteArrayOutputStream output = new ByteArrayOutputStream();
                                        Base64OutputStream boutput = new Base64OutputStream(output);
                                        output.write("data:text/html;base64,".getBytes());
                                        boutput.write(buffer.getArray());
                                        boutput.flush();
                                        boutput.close();
                                        output.flush();
                                        output.close();
                                        ElRecreo.URLresult = boutput.toString();
                                        System.err.println(ElRecreo.URLresult.toString());
                                      add(new SeparatorField());
 EditField viajes = new EditField("" , ElRecreo.URLresult.toString(), Integer.MAX_VALUE, Field.EDITABLE);
 add(viajes);      

                                         BrowserSession bSession = Browser.getDefaultSession(); //
                                         bSession.displayPage(output.toString());
                                      */
                                } catch (IOException e) {
                                        System.err.println("IO Excepcion: " + e.toString());
                                         ElRecreo.isRunning=false;
                                }
//)//while
                        }

                }//run

}

I'm tryng several ways to connect that's why several comments suggestions

TKS in advance

I solve it with a timer like this

try{
                                while(ElRecreo._strop32==null&& i<100) {
                                thread.sleep(1000);
                                i++;
                                }
                                 ObjectChoiceField _op32 = new ObjectChoiceField("", ElRecreo._strop32, 1);

I read the examples that you give me and I do not find any concrete example how implement

TKS anyway

Tags: BlackBerry Developers

Similar Questions

  • The problem that I have for a week, it is that my screen is fine when the laptop is plugged in but fades when it is not plugged in.

    I have a Samsung NC10 that I bought in 2008 and the problem I've had for a week, it is that my screen is fine when the laptop is plugged in but fades when not plugged in - it ' s like going to a brightly lit room, in a room where the lights are dimmed... What can I do to remedy this? My battery runs down? Can I us my laptop plugged it my battery die? I must admit that I left basically still my laptop plugged...

    Check the settings of the display under battery power and adjust accordingly - How to adjust the brightness of the screen under Windows XP.

  • Computer laptop screen goes black when the VGA cable is connected, but you press TV poster display correctly when the VGA button on the remote control.

    Computer laptop screen goes black when the VGA cable is connected, but you press TV poster display correctly when the VGA button on the remote control.   I need the laptop screen too.  It started just after years of correct use.

    Original title: VGA:

    In Panel > all items in the control panel > display > screen resolution you should be able to see the two devices / displays and be able to set options...

    http://Windows.Microsoft.com/en-us/Windows7/change-your-screen-resolution

  • End of 2015 iMac 27 inches 5K screen lights up when the "sleep mode"

    When the iMac is in "standby", sometimes the display lights for a while and then turns back off the coast. Screen does not completely, simply turn the backlight (it's like when you see a black image with the high brightness level).

    I know the iMac turns once in while when the "sleep mode" to access the internet and such things, but I don't like the screen turn on like that.

    Is there a question?

    Thank you for your collaboration.

    Probably not a problem, but to be sure that you can post a report EtreCheckon your system. We then look for obvious problems. Please click on the link, download the application and run the report. Once you have the report, please copy and paste into your response to this post.

    If you would like more information on what is EtreCheck, just click on the link and you will find a description of the application.

  • Screen turns off when the Satellite A45-S250 is moved in the direction of less

    Hello.

    I have a satellite A45-S250. I had no previous problem with this machine. However, when the computer is running too long, or it is moved in the slightest way the screen turns off. I don't even have to type very slowly - or I lose the screen.

    But also, as I have said - sometimes I won't even be near the computer and the screen turns off. When I lose the screen if the light shines on it - I can see, it's always VERY fair Sun. Generally, it will come if I use the FN + F5 button.

    I don't know if it is a screen problem or a connection problem. It occurs with increased frequency. Any suggestion would be appreciated.

    Thank you

    Mindylea1

    Hello

    From your description, I assume FL converter is defective and must be replaced. FL inverter is responsible for the background light and the typical symptom for faulty FL inverter is dimming or blinking display.

  • Randomly, the screen is blank when the charger is connected; generally very well during the execution of a battery

    We have a Dell Inspiron 6400 laptop.  When the charger is connected the screen will become black suddenly, and you can't seem to get the screen goes again.  It does not seem to close completely because when I press the power button twice (or more?) it brings back me to the password screen.

    This only occurs when you run the battery, IE. not connected charger.  I bought a new charger thinking that was the problem, but the same thing with the new charger.

    My only thought is that it could be the battery but unwilling to spend £60 on a new if it does not solve the problem.  And also the battery OK charges when the laptop is not activated.

    Help needed please!  Thank you very much.

    Hi Tiffany - Sorry a very very late thank you for your help on this.

    I've been very busy and have therefore been put off watching it.  We have been surviving off the battery and when he runs out to paralyze the system / sleep mode and reload.  It became quite frustrating and that's why I've decided that I really need to fix this problem.

    As you the advised, I went just through the safe mode and the problem occurred again glancing at your advice it seems there must be a hardware problem.  I had originally bought a spare power outlet, and this does not work then maybe it's the battery.  As you suggested, maybe a qualified support store is the best solution now.

    Thank you once more!  I am very grateful.

  • Computer screen remains empty when the computer is started.

    I recently moved my computer in a another part of the House and when I got back everything was working properly.  I was in the middle of the removal of unused on my computer programs when I had a program not responding do not message.  All the icons have disappeared off the screen and the taskbar, but I could still see the background.  I shut down the computer manually becase Ctrl + alt + delete didn't work.  Now, when I turn the computer on the gateway screen comes up and the green bar when windows is preparing to start, but it loads a blank screen. The only visible thing on it is the mouse pointer.  I tried to use the windows vista operating cd but it wont run it.  Any ideas?

    No you can hear it running.  I would say that it was computer games that I uninstall and the wireless card that I used on it, now it is connected directly to the wireless router. Also, I forgot to mention in the post above that I had the computer on it two weeks and when I had it up and running in the other room windows defender came on wanting scanner, so I let it scan and then the antivirus software did a scan of the computer.  They both finished without any problems.  My antivirus (McAfee) software installed updates at the time wherever it froze.

    go to safe mode (press f8 when you turn on your pc) then preform scan using

    Malwarebyte s

    and get avast download or try the mcafee update after scaning above programs using

    then in safe mode go to msconfig by typing it in the search box of windows and enter presing. then prepare your computer to clean boot by disabling all startup items and non-windows services. then restart?

    See if it solves your problem?

  • Call Dialog.ask in the Thread Run method

    "in I want to call Dialog.alert and using following code but its exception to throw the wire.

    "Exception occurs java.lang.RuntimeException: pushModalScreen called by a thread of non-event."

    synchronized (Application.getEventLock ())

    {

    if (Dialog.ask ("catalog is obsolete. You want to keep it? ", choices, select, select [0])(==1)"

    {

    Run the required functionality

    }

    }

    pls help me

    I keep saying this, so forgive me of repeating myself, but:

    synchronized (Application.getEventLock ()) {}

    should only be used when nothing else will work for you or you make a very simple, very fast UI update.

    A Dialog.ask is not very fast!

    In this case, you have several options, but the most obvious solution is to ask the question before starting the Thread.  So, if that is your treatment

    Thread catUpdateThread = new Thread() {}

    public void run() {}

    Dialog.ask (...)

    Other treatments

    }

    }

    catUpdateThread.start ();

    What should do the same and works OK. :

    UiApplication.getUiApplication.invokelater (new Runnable() {}

    public void run() {}

    Dialog.ask (...)

    If (result == Yes) {}

    Thread catUpdateThread =...;

    catUpdateThread... Start();

    }

    }

    });

  • Screen goes black when the unit reaches a point in 3d space.

    Hello

    I've simplified a more complicated model to try to understand what is happening, but I can't for the life of understand me. My camera starts to zoom in to a way of 3d layer in the distance. Everything's fine until it reaches a certain point, then the screen goes black. The camera did not run in the layer, I don't think that the lights have something to do with it. It just goes black. Any ideas?

    The first image is when the camera starts panning. The second is when the screen goes black. Note that the camera is still quite a distance between the 3d layer.

    Screen Shot 2011-12-01 at 12.46.04 AM.pngScreen Shot 2011-12-01 at 12.46.28 AM.png

    Thank you!

    If you turn on diagrams, you'll see that your camera is not pointed at the level of the layers. I don't know why you have animation camera rotation. You have the camera facing the path, is the point of interest to market? You may experience gimball lock.

    The best way to animate a camera must do 3D null parent. Now you have a camera on a cart. Gimbal lock is not a problem, point of interest is not a problem, and it's easy.

  • Satellite A100-237 screen remains off when the lid is opened

    OK I'll try my best to explain this. My power settings are adjusted so that the computer has no effect when the lid is closed - except for the display, which is turned off and back on when the lid is opened (normal behaviour).

    Now, in rare occasions, when I opened the back cover, the screen doesn't come back, unless I close the back cover and open again. It is not a big problem for me at the moment, but I'm afraid that the connections of the screen with the motherboard by the cover have been damaged.

    BIOS version 2.00, maybe an update could solve it?

    Thanks in advance.

    Hi Ataberk,

    I think that your problem can be caused by the micro-switch that will detect when the laptop lid is closed. If this switch is in the open position so your screen will remain off even with the lid open. The idea here is that you can get the display by closing and opening the lid again.

  • Use a channel when you declare two and it changes when the program runs.

    Hello

    For the use of a map of 4461:

    With the use of the library DAQmx:

    When I use 'Create Channel.vi' I can to use 'Ai0:1' to use the 2 input channels. Then I use the Nchannel Read and split the signal with for example a "Board index".

    But is it possible to change the channel numbers 'on the fly' so when the program is running?

    The same question with the outputs

    When I use the channel to create for outings and I use Ao0:1 to use 2 output channels, can but I change to a single channel when the program is running. Nchan write.vi is used, and this requires 2 channels. The use of a channel will give you an error.

    Is there a nice way to handel this?

    Greetings.

    You can change the output to a level of 0 volts instead of what you read. It should be just a case statement and the writing remains the same.

  • Computer screen appear not when the cover is open, please help!

    I use my 19-inch LCD TV as a monitor for my computer laptop windows 7, because the built-in screen broke some time it y a. yesterday, I changed the settings so that whenever I close the lid of the laptop, the screen is always displayed on the TV, but now, everytime I open the cover, broken laptop screen lights up and the connection to the TV is lost , but when I close the cover image appears upward on the TV again. I tried changing the settings I changed back. Anyway I can fix this without a keyboard? Because the only one I have is on my laptop and inaccessible without the lid open. Help, please!

    Hello Hipster,

    Being this recent, try a system restore to the most recent point when everything worked very well.  See http://www.sevenforums.com/tutorials/700-system-restore.html for more information.

    Good luck!

    Kosh

  • Scheduler - not triggered when the task "run if the user loged on or not."

    I m, creating a task that is mapped to a file is to run,

    I have his work automatically and manually when the option (button) "run only when the user is logged on" is selected.

    but the automatic/manual RACE does not work when the option (radio button) "Run if user logged on or not" is selected.

    Please help us to solve the issue.

    "Run If the user of connect or not" only works if the task does not call a user interface.  I have found this workaround to How to run. BAT files invisibly - Ramesh Srinivasan and it works successfully "Run if user logged in or not ' in Task Scheduler batch files now.

  • Compaq presario cq42 screen becomes black when the external monitor is unplugged

    Compaq presario cq42-137tu running windows 7 32 bit.

    I've been using a connected external display on the vga port and now every time I disconnect the monitor and restart the laptop the laptop LCD screen will display the original message of compaq and the black windows boot screen with the logo but then turns off. If I reconnect the extrnal monitor it will work fine (even if the external monitor is turned off)

    The screen of the laptop works fine without the external monitor connected in safe mode.

    I used both the HP support and the setting in the display panel to select single monitor and set the display on the screen of the laptop, but every time that the external monitor is not connected the screen turns off. The external screen does not need to be turned on, just to connect to the laptop monitor work. I also tried to download the graphics driver and put it back.

    If your laptop is a ComPaq base model then there is the (built-in) Intel UMA / GMA 4500 M - GL40 chipset with video memory sharing and you should consider downloading and installing the driver Intel graphics high definition (HD).

  • I'm restaurant a 2003 server machine work. She asked a gentleman confirmation with 'Yes' and 'no' buttons. I need a command that can answer that the dialogue when the schedule runs.

    Hi all

    I'm restaurant work that stops a service from one application to the 2003 server machine. She asked a gentleman confirmation with 'Yes' and 'no' buttons. I need a command that can answer that dialogue with 'Yes' at the time of the schedule runs.

    Thank you

    Arun

    Hello

    Are you referring to Windows Server 2003?

    The question you have posted is related to professional level support. Please visit the link below to find a community that will support what ask you:

    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer

Maybe you are looking for