Here you can find the source of GetUrlDrawable(String url)
public static Drawable GetUrlDrawable(String url)
//package com.java2s; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.util.Log; public class Main { public static Drawable GetUrlDrawable(String url) { try {//ww w . ja va 2s . c o m URL aryURI = new URL(url); URLConnection conn = aryURI.openConnection(); InputStream is = conn.getInputStream(); Bitmap bmp = BitmapFactory.decodeStream(is); return new BitmapDrawable(bmp); } catch (Exception e) { Log.e("ERROR", "urlImage2Drawable????????????imageUrl??" + url, e); return null; } } }