2012-09-24 142 views
0

我是新的android开发和日食Juno版本。我一直在尝试使用xml解析。在调试执行行以检索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. 

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

我错过了什么吗?

回答

0

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

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

没办法......同样的错误.. –

+0

u能提供您完整code..I想看看你有什么进口.. ?? –