Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
mbasheerk
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified
Accepted Solution

Locator.geocode thorws IllegalStateException

I want to get latitude and longitude of address, and I used

Locator.geocode

but it throws IllegalStateException ,request is made on the event dispatch thread

 

how can I solve this?

is possible to use Locator.geocode in my application, because if I use Locator.geocode any where in the source it throws exception,

Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Locator.geocode thorws IllegalStateException

From the javadocs:

 

An application must request geocode information outside of the event dispatch thread.

 

Start a worker thread and make the call from the thread.