Image not downloading in Android
<p>I have a bit of code that was working, but now isn't and I can't figure out why. I am trying to download an image from a URL, but nothing is being retrieved. I have the following code:</p>

<pre><code>URL u;
u = new URL("https://sites.google.com/site/mymoneymobilesite/rugbynut/leagues/league%20six%20nations.png");
URLConnection ucon = u.openConnection();
InputStream is = ucon.getInputStream();
Bitmap tmp_bmp = BitmapFactory.decodeStream(is);
</code></pre>

<p>Like I say, this was working months ago, but I've come to update some other code and found that it isn't anymore.</p>

<p>Can anyone help please?</p>

<p>UPDATE:
I have tried the code:</p>

<pre><code>InputStream iStream = (InputStream) u.getContent();
Drawable d = Drawable.createFromStream(iStream, "test");
</code></pre>

<p>but d is null. I use the same URL as above (the image is publicly available) and the application has no issues with connecting to the internet, as it is managing to download other data.</p>

<p>Any more ideas?</p>
