Wire for progress screen does not

I watched almost every thread on the subject, and no matter what I try, my code does not work.  Here's the scenario...  I have an application that needs to retrieve data when a user connects, so I want a popup screen to view the progress, on a separate thread, so that data recovery happening.  The problem is that no matter what I try, the progress screen is displayed AFTER the data recovery is complete.  In fact, it appear right after the closure of the LoginScreen.  What I need is for the progress screen will appear as soon as I start the thread.  This is the part that is away me the most.  I will stick by me, are important elements of the code below.  Any help would be greatly appreciated!

SerializableAttribute public class screen extends LoginScreen

{

....

public void onOk() / / the user has pressed the OK button after you enter the user ID and password

{
ProgressBar progressBar = new ProgressBar ("Test class", 8, 200);
progressBar.start ();

retrieve login data

Boolean success = authenticateSessionLogin (username, password, displayError);

progressBar.remove ();
If (success)

onClose();

on the other

manages the error log here

}

}

SerializableAttribute public class ProgressBar extends Thread
{
private maximum int, timeout;
Private boolean useful;
public PopupScreen popup.
Private GaugeField gaugeField;

/**
* Constructor of object
*
@param title
* The text to display in the popup box
maximum @param
* Range / field width gauge progress bar
@param timeout
* Milliseconds to pause between updates of the progress bar
* @see GaugeField
* @see wire
* @see PopupScreen
*/
Public ProgressBar (String title, maximum int, int timeout)
{
This.maximum = maximum;
This.Timeout = timeout;
       
DialogFieldManager Manager = new DialogFieldManager();
       
Popup = new PopupScreen (manager);
gaugeField = new GaugeField (null, 1, maximum, 1, GaugeField.NO_TEXT);
       
manager.addCustomField (new LabelField (title));
manager.addCustomField (gaugeField);
}
   
/**
* run() method for starting the thread
*/
public void run()
{
useful = true;
       
UiApplication.getUiApplication () .invokeLater (new Runnable()
{
public void run() {}
UiApplication.getUiApplication () .pushScreen (popup).
}
});

int iterations = 0;

While (useful)
{
try {}
Thread.Sleep (timeout);
}
catch (System.Exception e)
{
}

If (++ iterations > maximum)
iterations = 1;
Remove();
   
gaugeField.setValue (iterations);
}

If (popup.isDisplayed ())
//{
UiApplication.getUiApplication () .invokeLater (new Runnable()
{
public void run() {}
UiApplication.getUiApplication () .popScreen (popup).
}
});
//}
}

/**
* The thread stop method and remove the popup screen
*
*/
public synchronized void remove()
{
useful = false;
}
}

When I read this:

have an application that needs to retrieve data when a user connects, so I want a popup screen to view the progress, on a separate thread, so that data recovery happening

Looks like you make the connection in the thread of events and the user interface of your worker thread running. For me, it's just backwards. When you queue these 'invokeLater' calls, they will remain in the event queue until the HTTP request is complete. Then, your progress will be pup up from HTTP is finished.

You need to turn around. The progress dialog box is in the case of wire, HTTP is the worker threadm wher it does not interfere with the UI events queue.

Tags: BlackBerry Developers

Similar Questions

  • Double click on the ios10 lock screen does not display Apple pay even if it is enabled in the settings

    Double click on the ios10 lock screen does not display Apple pay even if it is enabled in the settings.

    Hello JPMain,

    Thank you for using communities of Apple Support. I understand Apple pay is not an option when the double click the Home button. I know access pay Apple for a locked screen can do so useful everyday. I'm happy to help you to get this resolved with you.

    I recommend first restart your iPhone. This can solve many unexpected behaviours. Follow the steps below if necessary.

    1. Press and hold the sleep/wake button until the Red slider appears.
    2. Drag the slider to turn off your device completely off.
    3. Once the device turns off, press and hold the sleep/wake button again until you see the Apple logo.

    Restart your iPhone, iPad or iPod touch

    If the problem persists, the next option would be to reset all settings. It takes all the defaults, including passwords and Wi - Fi networks, alerts, notifications, brightness, wallpaper and sounds. This will also remove your cards Pay of Apple. Even if no content is lost with this step, it is always a good idea to back up first. If you do not have a recent backup, use the following link for assistance if necessary.

    The backup of your iPhone, iPad and iPod touch

    Once you have correctly saved, reset all settings in settings > general > reset > reset all settings.

    Have a great day!

  • My touch screen does not work.

    My touch screen does not work. Sometimes, and other times I have to reboot. I restored my phone, but it still has the same problem. Any suggestions?

    The following information is taken from the HT201406 of the Apple KB article:

    If the screen of your iPhone, iPad or iPod touch does not respond to touch

    If your touch screen responds slowly, inconsistently, or not responding at all, follow these steps.

    Check your touch screen

    Make sure your hands are clean and dry, then try the following steps:

    1. If you have a case or a protective screen on your device, try removing it.
    2. Clean the screen with a soft, slightly damp, lint cloth.
    3. Unplug your unit.
    4. Restart your device. If you are unable to restart it, you can force restart your device.

    If your touch screen is still unresponsive as it should, contact the Support technique Apple or make your tablet in an Apple Store or Apple authorized service provider.

    Adjust your settings for tactile 3D

    If you have an iPhone 6s or later that does not properly respond to tactile 3D press, you can adjust the settings:

    1. Go to settings > general.
    2. Click Accessibility > Touch 3D.
    3. Then set the sensitivity of the setting.

    Get more help

  • my iphone 5 s screen does not work.

    my iphone 5 s screen does not work. Touch is responsive but display sows a lines vertical coloring...

    TNX for help

    Hello

    I suggest you contact Apple Support (mail service may be available) or make a Genius Bar reservation to have your iPhone verified and, if recommended by Apple, served (either under warranty or through paid repairs):

    To check your warranty status:

  • iPhone SE: rotation of the home screen does not work

    Hi guys,.

    I already looked for answers to this problem in discussions, but I couldn't find anything that solves the problem. Here's the situation:

    -brand new SE iPhone: he got yesterday and just imported my contacts, changed some settings and installed a few applications... that's all.

    -Home screen does not turn in landscape mode (my previous blackberry contact made it by default, so I'm used to doing all that on the phone horizontally keep and wasn't expecting such a problem with iPhone); rotation does not also happen in the app store. However, it runs perfectly landscape when you use applications (Calculator, messages, etc.).

    -J' tried the solutions suggested by other users in different threads:

    (1) checked the lock on the gray screen (it was off). tried to turn it on and then again on the way to see if the rotation is enabled without success.

    (2) looked in ' settings/display and brightness' to see if "zoom mode" has been activated to move it off but discovered that the iPhone SE (or his version of the iOS) has no "zoom mode" option in this Panel... no problem, but no solution: /.

    (3) I think that try a reset should not be necessary, that the phone is brand new and it behaved like that the first time I have it turned on (I reason?).

    (4) I read that some versions of the iPhone (for example 6) do not have the "home screen rotation" function (which, to me, seems completely absurd) and, supposedly, you can use the phone in portrait mode, while the 6s for a reason any the available option: the specs should be similar to the 6s, anyone know (for sure) if the home screen rotation is supported on the self?

    Thank you all in advance... I hope that someone will come up with a solution because I know, it seems a stupid thing, but for me, it's terribly boring.

    the plug should be similar to the 6s, anyone know (for sure) if the home screen rotation is supported on the self?

    To my knowledge, no.

    Barry

    P.S. I have a.

  • Qosmio DX730 and Win8 - touch screen does not work

    Hello

    My wife's parents bought a Toshiba Qosmio DX730 (model PQQ11A). They have recently upgraded to Windows 8 and the touch screen does not work now.

    The problem is lack of drivers (the monitor driver reports as a generic PnP monitor).

    I have went on the Toshiba site and selected downloads driver for the appropriate model and installed a number of drivers, including recommended NVidia display drivers. There is no drivers on the site that seem to install support for Toshiba touchscreen.

    Are there no drivers available for this model Windows 8? If not, is there another solution? If Yes, where can I find them. Any help very appreciated because they have nice and bought computer Windows 8 so they could use the touch functions.

    Thank you.

    Hello

    On the page of the Toshiba UE driver you can find drivers for Win 8.
    As far as I know that you will install the Toshiba display driver for the touch function works correctly.

    I found this driver.
    Please check if you can install this:
    [Win 8 TouchScreen software for Qosmio DX730 | http://eu.computers.toshiba-europe.com/innovation/download_driver_details.jsp?service=EU&selCategory = 2 & selFamily = 381 & selSeries = 366 & selProduct = 7338 & salt ShortMod = null & language = 13 & selOS = 40 & selType = all & rupload = Yes & monthupload = & dayupload = & useDate = null & mode = allMachines & search = & action = search & macId = & country = all & selectedLanguage = 13 & type = all & page = 1 & ID = 83418 & O SID =-1 & driverLanguage = 42]

  • Satellite C850-1LK - screen does not work

    I got the c850-1lk for about 6 months and it is running Windows 8.1. I started it this afternoon and to navigate on the internet for half an hour when the screen turns off (power and wifi lights still on and could hear the fan running). I turned it and then turn on again, but the screen does not light even if I assume that the laptop itself starts well.

    The laptop was not struck and no physical damage has ever been done for her. The only previous problems were related to windows and the update 8.1 where he managed to remove the bootloader, but I managed to fix it with a bootable Linux disc then a complete reset of the system. Linux isn't there anymore.

    Any help would be greatly appreciated.

    It's really not easy to say what the problem is here. Remove the battery and press the power for 30 seconds. Connect the power supply only and start it again.

    The problem when you do this?

  • Satellite Pro C660D - screen does not turn

    I just got my Satellite Pro C660D back from repair (for a faulty fan), but the screen does not light when I start the laptop.

    She lights up on the front (and I can rotate the block number power sp that the keyboard works).
    Any ideas?

    I agree, I mean the laptop should work just fine after it has been fixed by ASP so I think that something was not right here and the technician must check this!

  • Satellite L300 - 1-5 - the screen does not work

    Recently, I encountered a problem with my laptop, the screen does not work.
    I tested my inverter of the screen and my backlight lamp to see that if that was the problem, but they both worked perfectly, I then tried the entire screen with the parts and that worked too. (I tried in my friends Toshiba Satellite L300 - 217)

    Then I looked around online and got told to try to connect my laptop to an external monitor, so I did and the screen didn't work there either. So now I'm stuck, I have tried everything even made sure all connections aren't loose etc but it still does not.

    Anyone know what the problem with my laptop?

    Thank you, Tom

    Hey Buddy,

    > connect my laptop to an external monitor, so I did and the screen didn't work there either.
    This means that the internal monitor is ok and the reason must be the graphics card or card mother herself.

    I guess for now, you get only a screen empty and nothing happens on your laptop?

    In this case, you should contact the closest service provider authorized in your country. Just get in touch with the guys and ask for help. They can check the cell phone and fix it! ;)

  • right of the touch screen does not

    Hi apple, I dropped my iPhone 5 c not so long ago, and when I went to answer a text (my phone is locked with a password), I went to type my password in and the right side of my screen does not work, I tried to plug my phone into my computer , but it does not leave my access it from there because its locked and I cannot get in, is there a way to fix this? I can't lose anything on my phone because that have extremely important things on it and its not fully supported until that date.

    Thank you

    It is most likely just be a screen issue that will be fixed with replacing the screen.  Assuming that you are out of warranty and do not have Applecare... Your option at Apple is a permutation of the screen for $129 - make sure you call ahead and confirm that your Apple Store makes replacements of the screen in the House, many do not.  Apple offers a replacement by mail from the screen.

    Your independent repair option would be similar - find a local store reviewed well, providing a guarantee of at least 3 months on the repair, ideally 6 months or life.   Now would cost about $75 - $110 for a 5 series phone.   Do not take a shop based on price because of alternative screens vary in quality a little.   Find a store that uses parts of original quality and is backed by the best guarantee.

  • Satellite M30X-111 screen does not display anything but the external monitor works

    My laptop just screen does not display anything (like when the computer is turned off), but when I connect the external monitor, then the desktop is displayed on this screen. I tried to recover the laptop using the recovery disk and it worked again, but today, it stopped working again.

    Again, I must plug the external monitor, and after I tried to restart, I continue to pressing F8 but the startup mode is not come, the noise of when you press a button for too long beeps, however, the monitor of the laptop working again.

    How can I solve this problem?

    What do you do? You want to recover the laptop?
    If Yes, you n press any F8 but you will need to boot from the recovery CD by pressing the C key immediately after starting the laptop.

    But this question seems that you have accidentally switched to external display.
    I recommend checking the Fn + F5 option. This combination allow you to switch between the display and the external monitor.

  • HP Envy 120: Touch screen does not show. Buttons on the front are unresponsive.

    The touch screen does not appear or appears with vertical bands of color. Power switch; WiFi; Open on the front buttons do not work. It will be printed from the computer and printed the test page. After it printed the test page, it stops and will not respond to the buttons on the front, but will always show from the computer. I unplugged and plugged back in after waiting for 30 seconds.

    If it is not under warranty take it. Buy something else.

  • Model is SVF15215SNB Touch screen does not work - no. Pen or touch input is available

    My computer model is SVF15215SNB Touch screen does not work and it says no. Pen or touch input is available for this view kindly let me know the solution to address the issue

    Hello!

    It seems that the model number you provided is not a model for us.

    This Forum is for help and support for the products of Sony us.

    For assistance, please contact Sony support team in your area for the best support!

    Thank you!

    Sorry for the inconvenience!

    http://www.Sony-Asia.com/countryselector.html?HPID=countryselector:AsiaPacific

  • Satellite A60-122: screen does not work - rest black

    Hello!!

    Can someone help me please on a screen problem? I have a Toshiba Satellite A60-122 and when I turn it on the screen does not work. It remains black as if the power of the laptop was turned off. I tried to connect the laptop to an external monitor, but it still does not work. I have no more ideas of what can do to make it work.

    I already told to format the pc with the cd of restoration but without an image, it is impossible to do anything...
    Thank you

    Isabel

    Hello Isabel

    I'm not an expert, but if there is no image on LCD internal display and the external monitor, I assume that there is a problem with the graphics card. I think you should contact the customer Service of your country partner and let check the device.

    I also hope that the warranty is still valid and if something needs to be replaced they will do it for free.

    Bye and let us know if you have more information about it.

  • Satellite M60 - screen does not light when I reboot

    I have a Toshiba Satellite M60 and the screen does not come when I turn off or restart. It takes approximately 12 trials before it lights. When the screen does the computer not light again starts ok just no screen.

    I put in sleep mode if I don't want the hassle of trying to get the screen lights up. What is a screen problem or inverter?

    Any help would be appreciated.

    I doubt that someone who has no experience with this stuff will be able to replace anything on the motherboard.
    For me it sounds very risky and I think that it of better to take the machine to an experienced technician to do this in his own hand and damage the whole motherboard

Maybe you are looking for