BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 04-03-2005, 11:56 PM   #1
rimzim
Knows Where the Search Button Is
 
Join Date: Jan 2005
Location: MAH
Posts: 38
Default How to update GUI through a thread?

Please Login to Remove!

Hi All,

Im working on application, in which Im trying to update the GUI through a thread. However, its firing an exception: IllegalStateException. Is there any way to achieve the same stuff?
I also want to know that how can we create & trigger/fire a custom event.
Earlier reply is much appreciable.

-Abhi.
Offline  
Old 04-04-2005, 11:29 AM   #2
greenhut
Thumbs Must Hurt
 
Join Date: Feb 2005
Location: Atlanta, GA
Model: 8300
Carrier: tmo
Posts: 102
Default

Two options I've used that work well. One is to make your application (or whatever class you want to receive the event) implement GlobalEventListener, and then from the thred:
Code:
UiApplication app = UiApplication.getUiApplication();
ApplicationManager appMgr = ApplicationManager.getApplicationManager();
appMgr.postGlobalEvent(app.getProcessId() , 0xbc50f865b0f97608L, 0, 0, e, app);
In the receiving class, you MUST override eventOccurred
Code:
    public void eventOccurred(long guid,int data0,int data1,Object object0,Object object1)
    {
        if(guid == 0x4e1c549a48dcd405L)        
            {
            m_AppInfo = (AppInfo)object0;
            }
If you just want to pop a Dialog, this is probably easier:
Code:
UiApplication.getUiApplication().invokeLater(new Runnable() {
    public void run()
        {
        Dialog.inform(_resources.getString(STR_NO_COVERAGE));
        }
    });
Regards,

jeff
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Fanuc Motherboard A16B-3200-0429/07B picture

Fanuc Motherboard A16B-3200-0429/07B

$674.25



1PCS FANUC System Motherboard A20B-8100-0662 picture

1PCS FANUC System Motherboard A20B-8100-0662

$1697.00



Kalex Motherboard for Allen Bradley PanelView Plus 600 77162-730 picture

Kalex Motherboard for Allen Bradley PanelView Plus 600 77162-730

$89.96



ABB ACS880 motherboard ZCU-14 3AXD5000005164 1PCS picture

ABB ACS880 motherboard ZCU-14 3AXD5000005164 1PCS

$990.00



Used & Tested IPC PCI-6870F Motherboard picture

Used & Tested IPC PCI-6870F Motherboard

$255.11



New ADVANTECH PCA-6751 Motherboard picture

New ADVANTECH PCA-6751 Motherboard

$247.63







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