protected Object doInBackground(Object[] params){
try{Drawable drawable = null;
String url = “http://localhost:8080/WebDemo/imag1.jpg”;
URL objURL = new URL(url);
InputStream in = objURL.openStream();
drawable = Drawable.createFromStream(in,null);
}catch(Exception e){}
return drawable;
}
获取网络图片输入流
InputStream in = objURL.openStream();
通过输入流获取图片
drawable = Drawable.createFromStream(in,null);