Android之博客案例 及 获取指定URL的网页内容
16lz
2021-01-23
<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);
更多相关文章
- Android WindowManager$BadTokenException异常应对案例
- Android中 WebView打开一个网页实例
- android 从EditText中获取内容
- Android 通过网页打开自己的APP(scheme)
- cocos2d-x打开网页android与ios平台
- Android 读取配置文件的内容
- Android 获取扫码枪的扫描内容
- android按行读取文件内容的几个方法
- Android 网页html源码的查看器