views:

360

answers:

1

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 i could not able to call the getLocation() method inside button click event.It is throwing error as getLocation() method cannot called from event thread.Can any one tell me how to solve this problem.

+2  A: 

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

Richard