BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-03-2010, 11:40 AM   #1 (permalink)
New Member
 
Join Date: Dec 2009
Model: 8830
PIN: N/A
Carrier: bell mobility
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up IllegalStateException error

Please Login to Remove!

Hi,

I have a simple application with an UI which displays fixes, phone status and phone call number.

I implemented PositionListener and PhoneListener in separated classes.
When i run on simulator I got the "IllegalStateException" error when I tried to display the phone status and calling number (I simulate an Incoming call). The phone events are intercepted correctly. I add the phone listener in MainScreen class.

Below is the code used to display calling phone number on MainScreen:

public void callConnected(int callId)
{
System.out.println("fct-callConnected");
if(UiApplication.isEventDispatchThread() == true)
{
System.out.println("is Event Thread");
}
else
{
System.out.println("NOT Event Thread");
}
//phoneStatus = CONNECTED;
this.setPhoneStatus(CONNECTED);
displayPhoneNumber(callId);
displayPhoneStatus(CONNECTED);

}

and displayPhoneNumber function is:

private void displayPhoneNumber(int callId)
{
final PhoneCall call = Phone.getCall(callId);
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
phoneScreen.updatePhoneNumberLabel(call.getDisplay PhoneNumber());
}

});
}

When I simulate an incomming call the function "callConnected" is called (Ok) but when I tried to update PhoneNumber Label in MainScreen I got the error "IllegalStateException".

If I remove the InvokeLater() , because I'm not in another thread I got the same result.

My question is:

Should I run LocationListener and PhoneListener in different threads???

Thank you,
George.
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

NIB ASCO RED-HAT U8262C2 SOLENOID VALVE 1/8" NPT
$39.99
NIB ASCO RED-HAT U8262C2 SOLENOID VALVE 1/8Sloan Solenoid Replacement Kit
$206.99
Sloan Solenoid Replacement Kit picture1/8" DC24V 5 Way 2 Position Pneumatic Electric Solenoid Air Valve With Wire E5F1
$7.83
1/8MAC 45A-N00-DDAJ-1FM 24 VDC Pneumatic Solenoid Valve 45AN00DDAJ1FM
$19.99
MAC 45A-N00-DDAJ-1FM 24 VDC Pneumatic Solenoid Valve 45AN00DDAJ1FM pictureSMC NVFS4100-5FZ 21-26 VDC Single Solenoid Valve NVFS41005FZ
$19.99
SMC NVFS4100-5FZ 21-26 VDC Single Solenoid Valve NVFS41005FZ picture






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