Kumar
Kumar

Reputation: 5469

Blackberry - getLocation() method cannot be called from event thread

I want to get the longitude and latitude of device. I used location api to get the longtitude and latitude the problem now I am facing is that I could not call the getLocation() method inside button click event. It throws an error as getLocation() method cannot be called from event thread.Can any one tell me how to solve this problem?

Upvotes: 2

Views: 1508

Answers (1)

Richard
Richard

Reputation: 8920

You simply create another thread and call getLocation() from that thread. See the documentation for java.lang.Thread in the API documentation.

Upvotes: 6

Related Questions