当前位置:首页 » 安卓系统 » android选择图片多张

android选择图片多张

发布时间: 2024-01-17 10:52:46

❶ android如何从服务器取多张图片,在本地保存并显示

//获取connection conn = getURLConnection(url); is = conn.getInputStream(); //获取Bitmap的引用 Bitmap bitmap = BitmapFactory.decodeStream(is) //获取长度 int length = (int) conn.getContentLength(); if (length != -1) { byte[] imgData = new byte[length]; byte[] temp=new byte[512]; int readLen=0; int destPos=0; while((readLen=is.read(temp))>0){ System.array(temp, 0, imgData, destPos, readLen); destPos+=readLen; } bitmap=BitmapFactory.decodeByteArray(imgData, 0, imgData.length); }可能想得不是很完善,你可以参考参考。

热点内容
android访问json 发布:2025-10-19 22:50:53 浏览:363
要访问公网怎么配置路由 发布:2025-10-19 22:50:10 浏览:51
网络服务器怎么设ip 发布:2025-10-19 22:40:57 浏览:990
c语言各函数 发布:2025-10-19 22:30:09 浏览:982
route命令linux 发布:2025-10-19 22:13:05 浏览:430
aide导入源码 发布:2025-10-19 21:48:41 浏览:826
锐志哪个配置才是大轮毂 发布:2025-10-19 21:25:06 浏览:581
linux可以限制ftp 发布:2025-10-19 21:25:03 浏览:574
androidstudio配置要求 发布:2025-10-19 21:24:51 浏览:902
脚本创造 发布:2025-10-19 20:31:29 浏览:231