/** * 加載本地圖片 * @param url * @return */ public static Bitmap getLoacalBitmap(String url) { try { FileInputStream fis = new FileInputStream(url); return BitmapFactory.decodeStream(fis); ///把流轉化爲Bitmap圖片 } catch (FileNotFoundException e) { e.printStackTrace(); Log.d("www", "noyfund"); return null; } }
Bitmap bitmap = getLoacalBitmap(url); ImageView imgContent=(ImageView) convertView.findViewById(R.id.img_what); imgContent.setImageBitmap(bitmap);