I have the following line of code to download a Bitmap
:
bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
But what happens if the download is interrupted mid-download? Will the connection stay open? If yes, should I start a timer when I start downloading the image, and cancel if the image is not downloaded within, say, 60 seconds?
The JavaDoc says nothing about an interrupted download:
openConnection()
throws anIOException
if an error occurs while opening the connection.getInputStream()
throws anIOException
if no InputStream could be created.
Two scenarios I can foresee,