【问题标题】:Xml response retrieving issueXml 响应检索问题
【发布时间】:2012-09-24 06:00:36
【问题描述】:

我是 android 开发和 eclipse Juno 版本的新手。我一直在尝试 xml 解析。在调试执行行以检索 xml 时,最终出现以下错误。

// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
//Below Line Shows the Source not found error.
HttpResponse httpResponse = httpClient.execute(httpPost);

错误:

Class File Editor
Source not found
The source attachment does not contain the source for the file DefaultRequestDirector.class.

You can change the source attachment by clicking Change Attached source below:

Change Attached Source...

The source attachment does not contain the source for the file DefaultRequestDirector.class.

但我可以在 Android 4.1==>org.apache.http.impl.client 包中看到 DefaultRequestDirector.class。 尝试使用 Cmd+Shift+O 组合键,也尝试了 eclipse 中的“Clean”选项,但最终遇到了同样的问题。

我错过了什么吗?

【问题讨论】:

    标签: android eclipse eclipse-plugin


    【解决方案1】:

    试试下面的代码...看看是否有帮助:

    HttpClient httpclient = new DefaultHttpClient();
    HttpConnectionParams.setConnectionTimeout(httpclient.getParams(), 10000);
    HttpPost httppost = new HttpPost(url);
    HttpResponse response = httpclient.execute(httppost);
    

    【讨论】:

    • 你能提供你的完整代码吗..我想看看你导入了什么..??
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多