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

守給你的承諾、 提交于 2019-12-13 16:14:30

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/1756014/blackberry-getlocation-method-cannot-be-called-from-event-thread

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!