I .add(
new network calls to my Volley Request Queue which I have created as a singleton as suggested. But I always immediately .start()
these netw
If you create a requestQueue
as:
requestQueue = Volley.newRequestQueue(mAppContext);
you will not need start()
.
According to docs of Volley.RequestQueue
: "Creates a default instance of the worker pool and calls RequestQueue.start()
on it."
Hence you can see why you never needed to call start()
yourself.
However, if you create a requestQueue
as (as shown in the official reference):
RequestQueue mRequestQueue;
// Instantiate the cache
Cache cache = new DiskBasedCache(getCacheDir(), 1024 * 1024); // 1MB cap
// Set up the network to use HttpURLConnection as the HTTP client.
Network network = new BasicNetwork(new HurlStack());
// Instantiate the RequestQueue with the cache and network.
mRequestQueue = new RequestQueue(cache, network);
// Start the queue
mRequestQueue.start();
start()
will have to be called.
PS: I get the documentation as provided in the source code itself. IDEs are able to extract them effortlessly. I just hover over the method/class name whose document I need and press CTRL (in android-studio).
As a volley user I can tell you that I have never called .start() method. all the requests i've added to the queue started automatically, I used singleton class like you did.