Shashikala Chavan Shashikala Chavan - 1 year ago 466
Android Question

Android volley sending data twice

I am using Volley Network Library in my application.

The Issue is that it is sending data more than once when network connection is slow.

And After I Google this issue, all i can find about this issue is below point:


But I am not able to edit my volley library Hurlkstack classes.

It says:

The jar of this class file belong to container android Private libraries which does not allow modification to source attachments on it entries.

What should i do can some one help me

i have the following code where should i modify

private void makeJsonObjectRequest() {
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Method.POST,
"***.php", obj, new Response.Listener<JSONObject>() {
public void onResponse(JSONObject response) {
try {
} catch (JSONException e) {
}, new Response.ErrorListener() {
public void onErrorResponse(VolleyError error) {


Answer Source

No need to use connection.setChunkedStreamingMode(0); to avoid volley sending data twice bug. you need to set retry policy for current request :

JsonObjectRequest jsonObjReq = new JsonObjectRequest(...);
jsonObjReq.setRetryPolicy(new DefaultRetryPolicy(
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download