Android - cancel Volley request

后端 未结 4 1622
借酒劲吻你
借酒劲吻你 2020-12-06 16:53

I am using Android Volley lib in my project to execute network requests, all works very well but I have some troubles with the \"cancel\" feature of this lib. I explain my i

4条回答
  •  庸人自扰
    2020-12-06 17:40

    https://developer.android.com/training/volley/simple.html#cancel

    This basically says that

    Once cancelled, Volley guarantees that your response handler will never be called.

    So even if there is no way to undo/cancel an http request that's already begun (which makes sense), the callbacks associated with the request won't be called, which to me effectively means I can treat is a cancelled request in most scenarios even though the response thus received silently might be available in the cache.

提交回复
热议问题