I am using the following code to download a bitmap from a url,:
myFileUrl = new URL(fileUrl);
HttpURLConnection conn = (HttpURLConnection) myFileUrl
.openConnection();
conn.setDoInput(true);
conn.connect();
InputStream is = conn.getInputStream();
Bitmap bmpTemp = BitmapFactory.decodeStream(is);
but sometimes, I mean once in a hundred times, the bitmap is null! any body knows what might be the problem,
Thanks
There is a bug in the url connection. It has a fix that uses a FlushedInputStream decorator function for it.
here is the code for it:
the usage is: