2015年5月8日 星期五

[Android] set image from sd card


File imgFile = new  File(thumbnailPath);
if(imgFile.exists()){
  Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
  iv_liveView=(ImageView) listView.getChildAt(camIndex).findViewById(R.id.iv_liveView);   
  iv_liveView.setImageBitmap(myBitmap);  
} 

==================

          //----get photo from project                  Log.e("camIDArr[i] " +i,""+camIDArr[i]);
         Log.e("*tmp_index",""+tmp_index);
         item.put("image", mPics[i]);

         // ----get photo from sd card
String photoName = "main" + (i + 1) + ".jpg";
// new DownloadImagesToSdCard("http://spaceflightnow.com/news/n0211/04soho/sun.jpg",photoName,
// savePhotoPath);item.put("image", savePhotoPath + photoName);

沒有留言:

張貼留言