开发者

java.lang.InterruptedException While Trying to Get Location

Here is my code:

        Criteria criteria = new Criteria();
        LocationProvider locationProvider = LocationProvider.getInstance(criteria);
        Location currentLocation = locationProvider.getLocation(300);

It throws the exception at the third line. How can I开发者_运维问答 fix this?


Do you run your application in the simulator? If yes ,then you have to change the IT policy. Go to Simulate select Set IT Policy & GPS Location as given below.

java.lang.InterruptedException While Trying to Get Location

java.lang.InterruptedException While Trying to Get Location

java.lang.InterruptedException While Trying to Get Location

I hope this will help you.. :)


I figured it out. When I am in a closed area GPS cannot receive data and throws InterruptedException.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜