sameera liyanage wrote:actually i used Integer array for images,if i don't find a photo i give default image from drawable folder.So drawable images are represent as integers.
So the integer you want is specifically a Resource ID found in the R.drawable class (because that is how the integer you use for the default image would be used). Those IDs are created at compile time, so you can not do what you want. You need a different way of specifying the image.