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
Carrier: bell mobility
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up IllegalStateException error

Please Login to Remove!


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)
if(UiApplication.isEventDispatchThread() == true)
System.out.println("is Event Thread");
System.out.println("NOT Event Thread");
//phoneStatus = 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,
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

APPLE 820-0522-A 630-0895-B LITE VRAM 128K X 8 BOARD
APPLE 820-0522-A 630-0895-B LITE VRAM 128K X 8 BOARD   picture

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