我在这个网站上阅读了更多关于这个问题的文章,但我的问题仍然存在。我的清单包含以下权限:
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
但是当我调用我的 MapsActivity 的这个函数时:
private String getAddress(double latitudine, double longitudine) throws IOException{
Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(getApplicationContext(), Locale.ITALIAN);
addresses = geocoder.getFromLocation(latitudine, longitudine, 10);
String address = addresses.get(0).getAddressLine(0);
String city = addresses.get(0).getAddressLine(1);
String country = addresses.get(0).getAddressLine(2);
return address + ", " + city+ ", "+ country;
}
我收到此异常:12-05 12:49:01.500: W/System.err(26206): java.io.IOException: Service not Available
我不使用模拟器....
请帮助我很重要...