BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   trouble with dialog boxes (http://www.blackberryforums.com/developer-forum/180315-trouble-dialog-boxes.html)

jacytan 03-09-2009 09:21 PM

trouble with dialog boxes
 
hi,

i created a dialog box with a gauge field and a button.

all i wanted to do was after the gauge field is completed, or the button is clicked, the dialog will be closed.

i enclosed the running of the gauge field inside a thread, so that the user can still click the button.

The problem is, after the thread, when i try to close the dialog box, it throws IllegalStateException. i don't even know where the exception is coming from or why it happened.

can somebody help me on this?

thanks.

hrbuckley 03-09-2009 09:39 PM

You will have to close the dialog on the event thread. The easiest way to do this is with a call to UiApplication.getUiApplication().invokeLater(...). There are other ways to do it, but this seems to be the best way IMO.


All times are GMT -5. The time now is 10:36 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.