[img]http://dl2.iteye.com/upload/attachment/0099/2750/927ef374-3012-3772-ae51-300688281571.jpg[/img]
<ImageView android:id="@+id/imgv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/aa" />
通过读取Http的图像资源来获取
URL aURL = new URL("http://your-server/imagexxx.jpg");
URLConnection conn = aURL.openConnection();
conn.connect();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
iv.setImageBitmap(bm);
[img]http://dl2.iteye.com/upload/attachment/0099/2748/a11e0dc9-a0c1-368b-844d-4fd1e5fb720a.jpg[/img]
<ImageView android:id="@+id/imgv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/aa" />
通过读取Http的图像资源来获取
URL aURL = new URL("http://your-server/imagexxx.jpg");
URLConnection conn = aURL.openConnection();
conn.connect();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
iv.setImageBitmap(bm);
[img]http://dl2.iteye.com/upload/attachment/0099/2748/a11e0dc9-a0c1-368b-844d-4fd1e5fb720a.jpg[/img]