Volley and AsyncTask

后端 未结 4 1691
感动是毒
感动是毒 2020-12-02 15:14

I read a post about Volley and I know it\'s great networking library. But I couldn\'t understand one thing.

All requests are Async Task or not?

When I want

4条回答
  •  醉话见心
    2020-12-02 15:58

    The whole point of introducing Volley library was to make sure user doesnt have to worry about all the "obvious" stuff while sending a network request. This means that volley takes care of the following on its own

    • Switching Background thread
    • Transparent disk and memory response
    • Multiple concurrent network connections. etc

    To answer your question- You don't need to worry about switching to background thread, Volley takes care of this on its own. Also once the request is completed the success or failure callback is invoked on the main thread.Hence with Volley developer need not worry about switching threads

    This tutorial here gives a good step by step explanation of Working with Volley Library

提交回复
热议问题