Skip to content

Instantly share code, notes, and snippets.

@lmeadors
Created May 7, 2013 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmeadors/5536229 to your computer and use it in GitHub Desktop.
Save lmeadors/5536229 to your computer and use it in GitHub Desktop.
image download
protected Bitmap doInBackground(String... urls) {
final String imageUrl = urls[0];
Log.d(TAG, "looking for " + imageUrl);
try {
final String localUrl = imageCache.getLocalImage(imageUrl);
final InputStream inputStream = new URL(localUrl).openStream();
return BitmapFactory.decodeStream(inputStream);
} catch (Exception e) {
Log.e("Error", e.toString(), e);
}
Log.d(TAG, "returning null bitmap for " + imageUrl);
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment