I have doubt in the code provided in documentation for Sending A Simple Request.
val queue = Volley.newRequestQueue(this)
val url = "https://www.google.com"
// Request a string response from the provided URL.
val stringRequest = StringRequest(Request.Method.GET, url,
Response.Listener<String> { response ->
// Display the first 500 characters of the response string.
textView.text = "Response is: ${response.substring(0, 500)}"
},
Response.ErrorListener { textView.text = "That didn't work!" })
// Add the request to the RequestQueue.
queue.add(stringRequest)
In this code first A Request is being made to the url and then the stringRequest is getting stored in the Queue. My doubt is that on making the request we will get a response, then what is the need of storing it the Queue and then rerunning all the operations like Checking in Cache Memory etc.