Created
January 7, 2016 00:56
-
-
Save Suleiman19/6da9be86f4f9714b9650 to your computer and use it in GitHub Desktop.
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 DownloadImageBitmap(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("IMAGE", "Error getting bitmap", e); | |
} | |
return bm; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
imports?