当前位置:首页 » 安卓系统 » 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); }可能想得不是很完善,你可以参考参考。

热点内容
随机启动脚本 发布:2025-07-05 16:10:30 浏览:516
微博数据库设计 发布:2025-07-05 15:30:55 浏览:19
linux485 发布:2025-07-05 14:38:28 浏览:299
php用的软件 发布:2025-07-05 14:06:22 浏览:751
没有权限访问计算机 发布:2025-07-05 13:29:11 浏览:427
javaweb开发教程视频教程 发布:2025-07-05 13:24:41 浏览:689
康师傅控流脚本破解 发布:2025-07-05 13:17:27 浏览:234
java的开发流程 发布:2025-07-05 12:45:11 浏览:681
怎么看内存卡配置 发布:2025-07-05 12:29:19 浏览:278
访问学者英文个人简历 发布:2025-07-05 12:29:17 浏览:828