09-10-2007, 10:09 AM
|
#1 (permalink)
|
| New Member
Join Date: Aug 2007 Model: 8700 PIN: N/A Carrier: T1
Posts: 9
Post Thanks: 0 Thanked 0 Times in 0 Posts
| Updating UI from a callback method Please Login to Remove! Hi,
I have a mainscreen that I push using the current UiApplication appearing on the screen.
UiApplication.getUiApplication().pushScreen(myScre en);
I register a listener to an object present in myScreen. When the listener calls the callback method, i want to update myScreen with new fields.
I learnt that the thread where the callback method is being executed is not the eventDispatchThread using the UiApplication.isEventDispatchThread(). I tried doing as follows but get an IllegalStateException:
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
// Add new fields to the mainscreen already pushed.
myscreen.invalidateLayout();
}
});
Can someone please help me understand what I am doing incorrectly?
thanks. |
| Offline
| |