I have experienced a problem with volley where a request sometimes gets hit twice to the server and as a result, this pretty much messes up my code logic. Is there a way I can limit the number of requests to 1? I have tried doing what is explained here but the problem still occurs sometimes
I just thought I could answer this, i figured out the solution. Google finally adopted the volley library and this is the official repo to add to your dependencies
compile 'com.android.volley:volley:1.0.0'
Also, add this to your string request. Set the DEFAULT_TIMEOUT_MS
multiple times, like in my case, i set it to 5
stringRequest.setRetryPolicy(new DefaultRetryPolicy(DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 5, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With