Android RecyclerView → Android Material FilePicker tutorial – Pick Multiple images and show in a RecyclerView – Camposha

Android RecyclerView

Android RecyclerView

Android RecyclerView

Android Material FilePicker tutorial – Pick Multiple images and show in a RecyclerView


Android Material FilePicker tutorial – Pick Multiple images and show in a RecyclerView.


Android FilePicker tutorial. We show how to pick multiple images using Material FilePicker and show them in a RecyclerView. Please watch the video tutorial step by step for explanations.


Tools Used

This example was written with the following tools:

  • Windows 8
  • AndroidStudio IDE
  • Genymotion Emulator
  • Language : Java

Lets start.

1. Build.Gradle App Level

apply plugin: ''

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.tutorials.hp.filepickerrecyclerview"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile ''
    compile ''
    compile ''
    compile 'com.droidninja:filepicker:1.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'


package com.tutorials.hp.filepickerrecyclerview;


public class Spacecraft {
    String name;
    Uri uri;

    public String getName() {
        return name;

    public void setName(String name) { = name;

    public Uri getUri() {
        return uri;

    public void setUri(Uri uri) {
        this.uri = uri;


package com.tutorials.hp.filepickerrecyclerview.mRecycler;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.tutorials.hp.filepickerrecyclerview.R;

public class MyViewHolder extends RecyclerView.ViewHolder {

    TextView nameTxt;
    ImageView img;

    public MyViewHolder(View itemView) {

        nameTxt= (TextView) itemView.findViewById(;
        img= (ImageView) itemView.findViewById(;


#### 4.

package com.tutorials.hp.filepickerrecyclerview.mRecycler;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.squareup.picasso.Picasso;
import com.tutorials.hp.filepickerrecyclerview.R;
import com.tutorials.hp.filepickerrecyclerview.Spacecraft;

import java.util.ArrayList;

public class MyAdapter extends RecyclerView.Adapter<MyViewHolder> {

    Context c;
    ArrayList<Spacecraft> spacecrafts;

    public MyAdapter(Context c, ArrayList<Spacecraft> spacecrafts) {
        this.c = c;
        this.spacecrafts = spacecrafts;

    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v= LayoutInflater.from(c).inflate(R.layout.model,parent,false);
        return new MyViewHolder(v);

    public void onBindViewHolder(MyViewHolder holder, int position) {

        Spacecraft s=spacecrafts.get(position);


    public int getItemCount() {
        return spacecrafts.size();


6. ActivityMain.xml

#### ContentMain.xml

7. Model.xml

How To Run

  1. Download the project.
  2. You’ll get a zipped file,extract it.
  3. Open the Android Studio.
  4. Now close, already open project.
  5. From the Menu bar click on File >New> Import Project.
  6. Now Choose a Destination Folder, from where you want to import project.
  7. Choose an Android Project.
  8. Now Click on “OK“.
  9. Done, your done importing the project,now edit it.

More Resources

Resource Link
GitHub Browse Browse
GitHub Download Link Download

Best Regards,

Leave a Reply

Your email address will not be published. Required fields are marked *

Join Us