This is a simple routine to show an image file from the SD card in a view. Calling Convention:
ImageView pic = (ImageView)this.findViewById(R.id.picview);
JBRoutines.ShowPicture(Constants.PICTURE_FILE, pic);
public static void ShowPicture(String fileName, ImageView pic) {
File f = new File(Environment.getExternalStorageDirectory(), fileName);
FileInputStream is = null;
try {
is = new FileInputStream(f);
} catch (FileNotFoundException e) {
Log.d("error: ",String.format( "ShowPicture.java file[%s]Not Found",fileName));
return;
}
Bitmap = BitmapFactory.decodeStream(is, null, null);
pic.setImageBitmap(bm);
}
1 Comment
good if it's code work