當前位置:首頁 » 安卓系統 » 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