Info

ft Android m&immmm. n^mm^mm

Java imputstream flit, «SJSffiEa^ift^^ric ^ bitMapo bitMap image View Wo FfflW rcturnBitMap ifefi XSCPfWffiffl M, 'Sft URL

BitMap, ttWinT0PF«

public Bitmap returnBitMap(String url) I URL myFileUr1 = null; Bitmap bitmap null; try (

myFileUrl = new URL(url); ) catch (MalformedURLException e) {

e.printStackTrace(); }

Ht.tpURLConnection conn = (HttpURLConnection) myFileUrl .openConnection(); conn.se t Do1nput(t rue); conn.connect();

InputStream is - conn.get InputStream(); bitmap BitmapFactory.decodeStream(is); is.close();

) catch (IOException e) { e.printStackTrace(); I

return bitmap;

0 0

Post a comment