com.android.volley.Request.isCanceled()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(148)

本文整理了Java中com.android.volley.Request.isCanceled方法的一些代码示例,展示了Request.isCanceled的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.isCanceled方法的具体详情如下:
包路径:com.android.volley.Request
类名称:Request
方法名:isCanceled

Request.isCanceled介绍

[英]Returns true if this request has been canceled.
[中]如果此请求已被取消,则返回true。

代码示例

代码示例来源:origin: chentao0707/SimplifyReader

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: mcxiaoke/android-volley

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: mcxiaoke/android-volley

@SuppressWarnings("unchecked")
  @Override
  public void run() {
    // If this request has canceled, finish it and don't deliver.
    if (mRequest.isCanceled()) {
      mRequest.finish("canceled-at-delivery");
      return;
    }
    // Deliver a normal response or error, depending.
    if (mResponse.isSuccess()) {
      mRequest.deliverResponse(mResponse.result);
    } else {
      mRequest.deliverError(mResponse.error);
    }
    // If this is an intermediate response, add a marker, otherwise we're done
    // and the request can be finished.
    if (mResponse.intermediate) {
      mRequest.addMarker("intermediate-response");
    } else {
      mRequest.finish("done");
    }
    // If we have been provided a post-delivery runnable, run it.
    if (mRunnable != null) {
      mRunnable.run();
    }
  }
}

代码示例来源:origin: chentao0707/SimplifyReader

@SuppressWarnings("unchecked")
  @Override
  public void run() {
    // If this request has canceled, finish it and don't deliver.
    if (mRequest.isCanceled()) {
      mRequest.finish("canceled-at-delivery");
      return;
    }
    // Deliver a normal response or error, depending.
    if (mResponse.isSuccess()) {
      mRequest.deliverResponse(mResponse.result);
    } else {
      mRequest.deliverError(mResponse.error);
    }
    // If this is an intermediate response, add a marker, otherwise we're done
    // and the request can be finished.
    if (mResponse.intermediate) {
      mRequest.addMarker("intermediate-response");
    } else {
      mRequest.finish("done");
    }
    // If we have been provided a post-delivery runnable, run it.
    if (mRunnable != null) {
      mRunnable.run();
    }
  }
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

@SuppressWarnings("unchecked")
  @Override
  public void run() {
    // If this request has canceled, finish it and don't deliver.
    if (mRequest.isCanceled()) {
      mRequest.finish("canceled-at-delivery");
      return;
    }
    // Deliver a normal response or error, depending.
    if (mResponse.isSuccess()) {
      mRequest.deliverResponse(mResponse.result);
    } else {
      mRequest.deliverError(mResponse.error);
    }
    // If this is an intermediate response, add a marker, otherwise we're done
    // and the request can be finished.
    if (mResponse.intermediate) {
      mRequest.addMarker("intermediate-response");
    } else {
      mRequest.finish("done");
    }
    // If we have been provided a post-delivery runnable, run it.
    if (mRunnable != null) {
      mRunnable.run();
    }
  }
}

代码示例来源:origin: chentao0707/SimplifyReader

if (request.isCanceled()) {
  request.finish("network-discard-cancelled");
  continue;

代码示例来源:origin: mcxiaoke/android-volley

if (request.isCanceled()) {
  request.finish("network-discard-cancelled");
  continue;

代码示例来源:origin: jiangqqlmj/FastDev4Android

if (request.isCanceled()) {
  request.finish("network-discard-cancelled");
  continue;

代码示例来源:origin: mcxiaoke/android-volley

if (request.isCanceled()) {
  request.finish("cache-discard-canceled");
  continue;

代码示例来源:origin: chentao0707/SimplifyReader

if (request.isCanceled()) {
  request.finish("cache-discard-canceled");
  continue;

代码示例来源:origin: jiangqqlmj/FastDev4Android

if (request.isCanceled()) {
  request.finish("cache-discard-canceled");
  continue;

代码示例来源:origin: MewX/light-novel-library_Wenku8_Android

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: com.mcxiaoke.volley/library

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: googolmo/OkVolley

@Override
  public boolean isCanceled() {
    return super.isCanceled();
  }
}

代码示例来源:origin: xuningjack/AndroidNet

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: tazimete/android-app-food-delivery-system

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: jungletian/TitanjumNote

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: chuyangliu/tastysnake

@Override
public boolean isCancelled() {
  if (mRequest == null) {
    return false;
  }
  return mRequest.isCanceled();
}

代码示例来源:origin: cat9/EasyVolley

@Override
  public void run() {
    if (mRequest.isCanceled()) {
      return;
    }
    mRequest.deliverProgress(isUpload,current,total);
  }
}

相关文章