Huseyin Baduk Huseyin Baduk - 1 year ago 97
Android Question

Android - Recyclerview adapter show Images from External Storage

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?

Answer Source

For basic functionality of RecyclerView adapters:

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download