【发布时间】:2015-06-08 07:53:46
【问题描述】:
我正在我的 android 应用程序中的注册页面上工作,并且我已经成功完成,没有任何错误。但我有一个问题。某些类显示为已弃用。
HttpClient httpClient = new DefaultHttpClient();
HttpContext httpContext = new BasicHttpContext();
HttpGet httpGet = new HttpGet(url);
try {
HttpResponse response = httpClient
.execute(httpGet, httpContext);
InputStream inputStream = response.getEntity().getContent();
input = (inputStreamToString(inputStream).toString())
.replaceAll("\\s+", "");
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
在这段代码中,HttpClient、HttpContext、HttpGet、HttpResponse、HttpClient、ClientProtocolException 显示为已弃用。这有什么问题吗?如何在我的应用程序中使用最新的课程?
【问题讨论】:
-
使用 HttpUrlConnection 代替 Apache 的客户端
标签: android httpclient deprecated