I want create image gallery with RecyclerView where use images from phone. I didn't find any RecyclerView adapter which fill image with File type. Is it possible?
Asked
Active
Viewed 2,265 times
2 Answers
1
For basic functionality of RecyclerView adapters: http://guides.codepath.com/android/Using-the-RecyclerView
In your onBindViewHolder
, you can get your image like this:
String path = Environment.getExternalStorageDirectory() + "/myImage.jpg";
Bitmap bitmap = BitmapFactory.decodeFile(path);
(more info on getting images from external storage)
and use it with an ImageView or something similar.

Community
- 1
- 1

Felix Edelmann
- 4,959
- 3
- 28
- 34
-
1Thank you.. I wrote adapter by use Bitmap – Huseyin Sep 17 '16 at 12:10
1
It's works
@Override
public void onBindViewHolder(RecyclerViewHolders holder, int position) {
holder.countryName.setText("Img");
Bitmap bitmap = BitmapFactory.decodeFile(newList.get(position));
holder.countryPhoto.setImageBitmap(bitmap);
}

Huseyin
- 567
- 6
- 17