黑莓 - 的getLocation()方法不能从事件线程调用 [英] Blackberry - getLocation() method cannot be called from event thread

查看:130
本文介绍了黑莓 - 的getLocation()方法不能从事件线程调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要得到的经度和设备的纬度。我使用的位置API获取经度和纬度我现在面临的问题是,我可以不叫按钮单击事件中的的getLocation()方法。它抛出一个错误的getLocation()方法不能从事件thread.Can任何一个所谓的告诉我怎么解决这个问题?

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?

推荐答案

您只需创建另一个线程,并从该线程中调用的getLocation()。见java.lang.Thread中的文档的API文档中

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

这篇关于黑莓 - 的getLocation()方法不能从事件线程调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆