Skip to content

Commit

Permalink
页面销毁自动cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
pengjianbo committed Feb 17, 2016
1 parent 0249e1c commit 4555789
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ protected void onPostExecute(ResponseData responseData) {
OkHttpCallManager.getInstance().removeCall(url);
//判断请求是否在这个集合中
if (!HttpTaskHandler.getInstance().contains(requestKey)) {
HttpRequest.cancel(url);
return;
}

if (callback != null) {
callback.headers = responseData.getHeaders();
callback.onResponse(responseData.getResponse(), responseData.getHeaders());
callback.setResponseHeaders(responseData.getHeaders());
callback.onResponse(responseData.getResponse(), responseData.getHeaders());
}

if (!responseData.isResponseNull()) {//请求得到响应
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,9 @@ compile 'cn.finalteam:okhttpfinal:2.0.1'
##eclipse使用
下载OkHttpFinal对应的[Jar](https://github.com/pengjianbo/OkHttpFinal/tree/master/downloads) 和下载依赖[Extra Jar](https://github.com/pengjianbo/OkHttpFinal/tree/master/downloads/extra)

## 2.0.0更新内容
* 更新OkHttp3
* 下载管理分离
* 解决公共参数更新bug
* 解决List<Bean>类型转换问题
* 添加JsonArrayHttpRequestCallback回调类
* 多文件上传
* 添加URL编码
* 请求参数支持添加文件集合
* 整理代码/优化设计
## 2.0.2更新内容
* 添加拦截器
* 解决onProgress回调方法在非Main线程执行问题

---
Demo apk:![DEMO APK](images/okhttpfianl-sample-qrcode.png)
Expand Down

0 comments on commit 4555789

Please sign in to comment.