Android 应用程序无法识别 setRedirectStrategy?
我正在尝试使用 apache 的 httpclient 库编写一个 Android 应用程序,尽管此代码片段在实际的 Java 项目中编译时会出现错误 The method setRedirectStrategy(new DefaultRedirectStrategy(){}) is undefined for the type DefaultHttpClient 当我把它放入一个android应用程序中。有人知道原因吗?
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.setRedirectStrategy(new DefaultRedirectStrategy() {
I am trying to write an android app with apache's httpclient library, and although this code snippet compiles when it is in a actual Java project, it has the error The method setRedirectStrategy(new DefaultRedirectStrategy(){}) is undefined for the type DefaultHttpClient when I put it into an android app. Does anybody know the reason?
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.setRedirectStrategy(new DefaultRedirectStrategy() {
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RedirectStrategy
是通过 4.1。 Android(显然)有一个更接近的版本到 4.0。The
RedirectStrategy
was introduced with 4.1. Android (apparently) has a version closer to 4.0.