好的..我已经看到了很多关于这个的问题:例如
地理编码器错误 java.io.IOException: Unable to parse response from server and much more..Nothing give me a reply!!
谁能帮我 ??我的应用程序可以正常运行几分钟,但在其余时间会出现 IOException :
Geocoder gcd = new Geocoder(getApplicationContext(), Locale.getDefault());
List<Address> addresses = null;
try {
addresses = gcd.getFromLocation(location.getLatitude(), location.getLongitude(), 1);
if (addresses!= null && addresses.size() > 0 )
txtLat.setText(addresses.get(0).toString());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我的日志是:
07-30 16:24:20.351: W/System.err(5170): java.io.IOException: Unable to parse response from server
07-30 16:24:20.351: W/System.err(5170): at android.location.Geocoder.getFromLocation(Geocoder.java:136)
07-30 16:24:20.351: W/System.err(5170): at com.example.test.MainActivity.onLocationChanged(MainActivity.java:46)
07-30 16:24:20.351: W/System.err(5170): at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:227)
07-30 16:24:20.351: W/System.err(5170): at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:160)