Created
November 4, 2011 10:11
-
-
Save skayred/1339038 to your computer and use it in GitHub Desktop.
Out loader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static Bitmap fetchImage(String url) { | |
| URL fileUrl = null; | |
| try { | |
| fileUrl = new URL(url); | |
| } catch (MalformedURLException exc) { | |
| return null; | |
| } | |
| try { | |
| HttpURLConnection conn = (HttpURLConnection) fileUrl.openConnection(); | |
| conn.setDoInput(true); | |
| conn.connect(); | |
| InputStream is = conn.getInputStream(); | |
| return BitmapFactory.decodeStream(is); | |
| } catch (IOException exc) { | |
| return null; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment