BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   IllegalStateException issue when closing a PopupScreen (http://www.blackberryforums.com/developer-forum/200390-illegalstateexception-issue-when-closing-popupscreen.html)

return0 08-10-2009 04:34 AM

[SOLVED]IllegalStateException issue when closing a PopupScreen
 
Hi all,

I've got a PopupScreen that uses a LocationProvider to get a GPS position and that displays acquire state.
But there is an IllegalStateException when trying to close it in the
Code:

public void locationUpdated(LocationProvider provider, Location location)
event invoked by my LocationProvider. I already tried with the
Code:

synchronized(UIApplication.getEventLock()) {
this.close();
}

and

Code:

synchronized(this) {
this.close();
}

in both popup screen and a method inside another component but it changes nothing at all :cry:. If anyone already saw this issue or have an idea about how to resolve this, it would be very helpfull for me.

Thanks in advance

return0 08-10-2009 05:19 AM

Issue solved by stopping the location provider before the closing method and by still using the synchronized property.
Code:

this.oLocationProvider.setLocationListener(null, 0, 0, 0);
synchronized(UiApplication.getEventLock()) {
this.close();
}

Sorry for the disturb, week end was very hard for me ;-)


All times are GMT -5. The time now is 05:00 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.