我正在尝试从以下代码访问我的uri
AsyncTask asyncTask = new AsyncTask() {
@Override
protected Object doInBackground(Object... params) {
AndroidHttpClient httpClient = AndroidHttpClient.newInstance("");
HttpUriRequest uriGetRequest = new HttpGet("http://localhost:8080/restsql-0.8.6/res/");
HttpResponse httpResponse = null;
try {
httpResponse = httpClient.execute(uriGetRequest);
;
} catch (Exception e) {
// TODO Auto-generated catch block
if(e!=null){
Log.e("ModelLoader", e.getMessage(), e);
}
Log.e("Model Loader", "Error while calling execute");
}
return httpResponse;
}
};
asyncTask.execute(new Object());
但httpresponse总是为空。甚至也没有例外。 我已经检查过有效的uri,如https://google.co.in/,并且工作正常。 我的浏览器URI也正常工作。 因为没有例外,我无法继续下去。