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.
I hope this will help you.. :)
I figured it out. When I am in a closed area GPS cannot receive data and throws InterruptedException.
精彩评论