I need to show an image by using the file name only, not from the resource id.
ImageView imgView = new ImageView(this); imgView.setBackgroundResource(R.drawa
You can use:
ImageView imgView = new ImageView(this); InputStream is = getClass().getResourceAsStream("/drawable/" + fileName); imgView.setImageDrawable(Drawable.createFromStream(is, ""));