Created
November 4, 2011 10:10
-
-
Save skayred/1339036 to your computer and use it in GitHub Desktop.
Uber loading
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 loadImage(String url) { | |
| Bitmap bm = null; | |
| try { | |
| URL aURL = new URL(url); | |
| URLConnection conn = aURL.openConnection(); | |
| conn.connect(); | |
| InputStream is = conn.getInputStream(); | |
| BufferedInputStream bis = new BufferedInputStream(is); | |
| bm = BitmapFactory.decodeStream(bis); | |
| bis.close(); | |
| is.close(); | |
| } catch (IOException e) { | |
| Log.e("photo.get", e.getMessage()); | |
| } | |
| return bm; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment