我在ICS上得到這個異常,而在2.2上運行正常。Http get exception目標主機在ICS上不能爲空
java.lang.IllegalStateException: Target host must not be null, or set in parameters. scheme=null, host=null, path=http://maps.googleapis.com/maps/api/geocode/json?latlng=32.0692342,34.7952296&sensor=true
這裏是我的代碼:
HttpGet request = new HttpGet(URLEncoder.encode(requestUrl, "UTF-8"));
HttpResponse response;
response = mHttpClient.execute(request);
你可以發佈requestUrl嗎?它似乎沒有適當的格式。 – kosa
http://maps.googleapis.com/maps/api/geocode/json?latlng=32.0692342,34.7952296&sensor=true – meh