5. 取消请求

可以通过请求的setTag()方法给请求设置TAG,需要取消这些请求时,用请求队列的cancelAll()方法取消带有特定TAG的请求。

为请求设置TAG:

stringRequest.setTag("xyz");
jsonObjectRequest.setTag("xyz");
postObjectRequest.setTag("xyz");
imageRequest.setTag("xyz");

取消所有带有"xyz"这个TAG的请求:

mQueue.cancelAll("xyz");

 

相关文章:

  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2021-08-20
  • 2021-10-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-09-29
  • 2022-02-07
  • 2021-08-30
  • 2022-12-23
相关资源
相似解决方案