Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

Latest news

Last at Mon, 6 Sep 2010 12:27:06
Topic: Let your feedback ideas flow
See more news »

Nutiteq on Twitter

12 weeks 2 days ago Nutiteq is proud sponsor of StateOfTheMap 2010 #sotm10

How to avoid IllegalThreadStateException

3 replies [Last post]
eborisow
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 05/19/2009

Hi,

I am trying to use a MapComponent on two different MainScreen classes (Blackberry API). The MapComponent is instantiated locally to each screen. The problem that I'm running into is if I instantiate the one MapComponent in MainScreen class #1, then try to instantiate a MapComponent in MainScreen class #2, I receive an IllegalThreadStateException error message. I tried using StopMapping, but then if I go back to the same screen again, the map doesn't work since I stopped it's operation. Is there a proper way to deal with this problem? The only other thing I could think of trying would be to create a singleton with the MapComponent and keep sharing it everywhere.

Any thoughts?

Thanks,
Eric

jaanussiim (not verified)

With current library implementation the best options is really to use one map component instance throughout whole application because some core implementation is statically shared.

If there is not a lot of screens switching, then other option would also be just creating/destroying screen specific map component instance on screen show/hide. But this is going to add some unneeded map creation/initialization/deinitialization overhead.

eborisow
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 05/19/2009

Jaanus,

Thanks. I implemented the MapComponent in a singleton and it is working well without receiving the IllegalStateException error.

Regards,
Eric

venkatesh92
User offline. Last seen 5 weeks 1 day ago. Offline
Joined: 07/22/2010

Hi eborisow,

How to implement Map component in a singleton

send me sample code..