tags:

views:

116

answers:

1

Dear All,

I need to display an image by specifying the file name instead of by using resource. E.g showImage("background.png") instead of showImage(R.drawable.background).

Any one knows how?

Thanks a lot.

+1  A: 

Read this Android Image Tutorial. There's an example that uses FileOutputStream to write an image, I'm sure there's FileInputStream, too. Here's another code example that downloads images and transforms them to an Inputstream that is decoded:

bmImg = BitmapFactory.decodeStream(is);
imView.setImageBitmap(bmImg);
schnaader