本文整理了Java中com.squareup.okhttp.Call.cancel()
方法的一些代码示例,展示了Call.cancel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Call.cancel()
方法的具体详情如下:
包路径:com.squareup.okhttp.Call
类名称:Call
方法名:cancel
暂无
代码示例来源:origin: wangdan/AisenWeiBo
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
// 停止网络请求,如果不为空
try {
if (mCall != null) {
mCall.cancel();
}
} catch (Throwable e) {
}
return super.cancel(mayInterruptIfRunning);
}
代码示例来源:origin: apache/servicemix-bundles
@Override
protected void interruptTask() {
this.call.cancel();
}
}
代码示例来源:origin: wufenglincheng/ImageTrans
@Override
public void run() {
call.cancel();
}
});
代码示例来源:origin: com.squareup.okhttp/okhttp-ws
/** Cancels the request, if possible. Requests that are already complete cannot be canceled. */
public void cancel() {
call.cancel();
}
代码示例来源:origin: licheedev/Custom-Glide-ModelLoader-Demo
/**
* 在UI线程中调用,取消加载任务
*/
@Override
public void cancel() {
mIsCanceled = true;
// 取消获取url
if (mFetchUrlCall != null) {
mFetchUrlCall.cancel();
}
// 取消下载文件
if (mFetchStreamCall != null) {
mFetchStreamCall.cancel();
}
}
}
代码示例来源:origin: com.dropbox.core/dropbox-core-sdk
@Override
public void abort() {
if (call != null) {
call.cancel();
}
cancelled = true;
close();
}
代码示例来源:origin: io.kubernetes/client-java
public void close() throws IOException {
this.call.cancel();
this.response.close();
}
}
代码示例来源:origin: kubernetes-client/java
public void close() throws IOException {
this.call.cancel();
this.response.close();
}
}
内容来源于网络,如有侵权,请联系作者删除!