BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 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
Default 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  
Old 09-26-2007, 12:52 AM   #2 (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
Default

I figured out the reason that I was calling invokeLater on non-eventThread and so it was throwing the IllegalAccessException.

Thanks.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

( 7 PC. ) EEPROM 24C16LN 8 PIN DIP, NEW
$14.95
( 7 PC. ) EEPROM 24C16LN   8 PIN DIP, NEW picture( 6 PC. ) EEPROM 24C32/P 8 PIN DIP, NEW
$14.95
( 6 PC. ) EEPROM 24C32/P   8 PIN DIP, NEW picture5 pcs. Nintendo NES Homebrew EEPROM, Texas Instruments 27C512-20, 9440, 64K, IR
$9.99
5 pcs. Nintendo NES Homebrew EEPROM, Texas Instruments 27C512-20, 9440, 64K, IR pictureST7271N5B1/CEH / ST7271N5B1 / ST7271 / ST EEPROM
$12.0
ST7271N5B1/CEH  / ST7271N5B1 / ST7271 / ST EEPROM  pictureGY-NEO6MV2 NEO-6M GPS Module Flight Control EEPROM RS232 TTL Antenna APM2.5
$5.5
GY-NEO6MV2 NEO-6M GPS Module Flight Control EEPROM RS232 TTL Antenna APM2.5 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.