The setImageResource(int resId) method is passed a resource identifier of type int , but you are trying to transfer a File object there.
If your collection consists of File objects (which are images), then you can display these images in the ImageView handleView as follows:
Bitmap myBitmap = BitmapFactory.decodeFile(mImg.get(position).getAbsolutePath()); holder.handleView.setImageBitmap(myBitmap);
Remark number 1:
Do not do this:
List mImg = new ArrayList();
Create a clearly typed collection to avoid further problems:
List<File> mImg = new ArrayList();
Remark number 2:
There is no need to store the List<File> in the adapter. It would be more rational to store just the list of paths to the files (and it would be even more rational to cache the bitmap themselves and use something like Picasso , but this is another story).
UPD .
More about storing paths:
Create a mImagesPaths list in which absolute paths to the files in the specified directory will be stored:
List<String> mImagesPaths = new ArrayList(); File[] files = new File(Environment.getExternalStorageDirectory(), "ssdf/").listFiles(); for(File file : files){ if(file.isFile()){ mImagesPaths.add(file.getAbsolutePath()); } }
Next, in the adapter, display them:
holder.handleView.setImageBitmap(BitmapFactory.decodeFile(mImagesPaths.get(position)));
The solution is probably not the best, but still.