I post a JsonRequest to a server. The server is slow and Volley tends to make multiple calls to the slow server because it didn\'t get a response from the first request (sin
Using your StringRequest Object or JsonObjectRequest Object or JsonArrayRequest Object call this method.
For example if the object is an instance of StringRequest, here is the method:
stringRequest.setRetryPolicy(new DefaultRetryPolicy(initialTimeoutMs, maxNumRetries,
backoffMultiplier ));
initialTimeoutMs The initial timeout for the policy.
maxNumRetries The maximum number of retries.
backoffMultiplier Backoff multiplier for the policy.
Below are the parameters which I gave.
stringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
First parameter says set InitialTimeout to 10 seconds.
Second parameter says set retry count tries to 0.
Third parameter is default.