I don’t know exactly why the retry time doesn’t work with your code, however I found a similar problem here .
Instead, I can tell you something that, it seems to me, is not suitable for your code, and invite you to accept my Volley usage model.
First of all, you create a new request queue for each request. This is not cool, you should have a RequestManager singleton containing one request queue, and use it.
Secondly, I do not know if this affects the retry time, I have a base request class and I set the retry time in the constructor. Then I extend this class whenever I need to implement a new request type. Then I instantiate the request, set callbacks and pass it to the query manager. The query manager adds it to one query queue, which I talked about.
Moreover, if you have not done so already, I suggest you use the Gson library to parse JSON objects.
This is my base query class that I use:
public class GsonRequest<T> extends Request<T> { protected Context context; protected final Gson gson = new Gson(); protected final Class<T> clazz; protected final TypeToken typeToken; protected Map<String, String> headers; protected Map<String, String> params; protected final Response.Listener<T> listener; public GsonRequest(final Context context, final int requestMethod, String url, Class<T> clazz, Response.Listener<T> listener, Response.ErrorListener errorListener) { super(requestMethod, url, errorListener); this.context = context; this.clazz = clazz; this.listener = listener; this.headers = new HashMap<>(); typeToken = null; setRetryPolicy(); } public GsonRequest(final Context context, final int requestMethod, String url, TypeToken typeToken, Response.Listener<T> listener, Response.ErrorListener errorListener) { super(requestMethod, url, errorListener); this.context = context; this.typeToken = typeToken; this.listener = listener; this.headers = new HashMap<>(); clazz = null; setRetryPolicy(); } @Override protected Map<String, String> getParams() throws AuthFailureError { return params != null ? params : super.getParams(); } @Override public Map<String, String> getHeaders() throws AuthFailureError {
It works like a charm for me. Hope this helps, if you need more help contact me