@Override
protected Drawable doInBackground(String... params) {
try{
String url = params[0].replace("\\", "");
Log.v("before", params[0]);
Log.v("after", url);
InputStream is = (InputStream) new URL(url).getContent();
Drawable d = Drawable.createFromStream(is, "src name");
return d;
}catch (Exception e) {
Log.e("Image Error", e.toString());
return null;
}
}
7-07 22:02:03.282: before(21811): "https://s3-sa-east-1.amazonaws.com/inradar.media/uploads/ads/ad-60cd15be59b21725e45c5cf388065527.jpg"
07-07 22:02:03.282: after(21811): "https://s3-sa-east-1.amazonaws.com/inradar.media/uploads/ads/ad-60cd15be59b21725e45c5cf388065527.jpg"
07-07 22:02:03.282: Image Error(21811): java.net.MalformedURLException: Protocol not found: "https://s3-sa-east-1.amazonaws.com/inradar.media/uploads/ads/ad-60cd15be59b21725e45c5cf388065527.jpg"
Stringliterals, that is string values hardcoded in the source code. Escape characters are removed (converted to a value) at runtime. The value in the logs is aStringin memory. It appears to contain leading and ending quotation marks". This will cause the URL parser to fail.Stringliteral (ie. in source code)String url = "\"http:\"";has theStringvalue"http:"at runtime. If your question refers to something like a JSON array["value1", "value2"], the answer depends on the parser. A proper parser will determine that the elements are JSON Strings and produce twoStringobjects in an array with the valuesvalue1andvalue2.