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

熱點內容
python安卓版 發布:2025-09-16 23:01:04 瀏覽:820
碼小易編程 發布:2025-09-16 23:00:56 瀏覽:332
在線音樂源碼 發布:2025-09-16 22:57:39 瀏覽:682
api開發php 發布:2025-09-16 22:06:15 瀏覽:596
mysql自動備份linux 發布:2025-09-16 21:58:33 瀏覽:944
怎麼用自己的伺服器ip做域名 發布:2025-09-16 21:49:57 瀏覽:916
vc為什麼能編譯不能用 發布:2025-09-16 21:48:03 瀏覽:744
編譯原理沖突圖的定義 發布:2025-09-16 21:26:45 瀏覽:811
安卓手機芯哪個牌子好 發布:2025-09-16 21:26:33 瀏覽:210
centos編譯安裝git 發布:2025-09-16 21:19:55 瀏覽:977