I have a problem with requesting a Volley GET on a slow network. Every time I see BasicNetwork.logSlowRequests in my LogCat, my GET request is executed twice or more, which leads to several (2 or more) postings for 1 request. I have already set up a retry policy, but that does not help.
This is my logcat
03-16 01:31:35.674: D/Volley(5984): [19807] BasicNetwork.logSlowRequests: HTTP response for request=<[ ] http://[myserver]/api/places 0xfa7d0c33 NORMAL 1> [lifetime=3824], [size=313], [rc=200], [retryCount=0] 03-16 01:31:35.704: D/Volley(5984): [1] Request.finish: 3853 ms: [ ] http://[myserver]/api/places 0xfa7d0c33 NORMAL 1
my code is: -
StringRequest strReq = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { pd.dismiss(); getColorDetails.getColorresponse(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { pd.dismiss(); if (error instanceof TimeoutError || error instanceof NoConnectionError) { showSignOutAlertDialog(context, "TimeoutError"); } else if (error instanceof AuthFailureError) { showSignOutAlertDialog(context, "AuthFailureError"); } else if (error instanceof ServerError) { showSignOutAlertDialog(context, "ServerError"); } else if (error instanceof NetworkError) { showSignOutAlertDialog(context, "NetworkError"); } else if (error instanceof ParseError) { showSignOutAlertDialog(context, "ParseError"); } } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { HashMap<String, String> headers = new HashMap<String, String>();
android android-volley
Krish Jun 16 '16 at 7:23 2016-06-16 07:23
source share