Sunday, May 15, 2016

URLConnection.getContentLength() returns -1 Error Solved

When android url connection getContentLength() returning negative value or URLConnection.getContentLength() returns -1 Error solved, This is Worked for me: urlConnection.setRequestProperty("Accept-Encoding", "identity"); So try this HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestProperty("Accept-Encoding",...

Page 1 of 1212345Next