title: RecyclerView showing nothing
body: <p>I'm making an app that, in theory, have to load images from my internal storage an showing it up on a RecyclerView. I think I followed all the steps correctly and after many unsuccessful tries I'm asking here. So I think the code to catch up the data to the adapter is wrong, but I cannot think of anything to verify that. Any help, Observation, suggestions are greatly appreciated. These are my files: </p>
  
  <p>Photos.java (Where I get the data):</p>
  
  <pre><code>public class Photos {
  static ArrayList&lt;String&gt; filenameListTemp=new ArrayList&lt;&gt;();
  static ArrayList&lt;File&gt; photosList=new ArrayList&lt;&gt;();
  
  public static ArrayList&lt;String&gt; getPhotos(File internal){
      File listFolers[]=internal.listFiles();
      if (listFolers!=null &amp;&amp; listFolers.length&gt;0){
          for (File file:listFolers) {
              if (file.isDirectory()){
                  getPhotos(file);
              }
              else {
                  if (file.getName().endsWith(".png")||file.getName().endsWith(".jpg")||file.getName().endsWith(".gif")||file.getName().endsWith(".bmp")){
                      String temp =file.getPath().substring(0,file.getPath().lastIndexOf('/'));
  
                      if (!filenameListTemp.contains(temp)){
                          filenameListTemp.add(temp); //This add names
                          photosList.add(file);// This add Files
                      }
                  }
              }
          }
      }
          return filenameListTemp;
      }
  }
  </code></pre>
  
  <p>RecyclerViewAdapter:</p>
  
  <pre><code>public class RecyclerViewAdapter extends RecyclerView.Adapter&lt;RecyclerViewAdapter.ViewHolder&gt; {
  
  Context context;
  ArrayList&lt;String&gt; photos=new ArrayList&lt;&gt;();
  LayoutInflater layoutinflater;
  
  
  
  public RecyclerViewAdapter(Context context, ArrayList&lt;String&gt; photos) {
      this.context=context;
      this.photos=photos;
      layoutinflater=LayoutInflater.from(context);
  }
  
  
  
  @Override
  public RecyclerViewAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View view=layoutinflater.inflate(R.layout.recyclerview_item_list,parent,false);
      RecyclerViewAdapter.ViewHolder holder=new RecyclerViewAdapter.ViewHolder(view);
      return holder;
  }
  
  @Override
  public void onBindViewHolder(RecyclerViewAdapter.ViewHolder holder, int position) {
  
          holder.image.setImageBitmap(BitmapFactory.decodeFile(photos.get(position)));
  
  }
  
  @Override
  public int getItemCount() {
      return photos.size();
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder {
      ImageView image;
  
      public ViewHolder(View itemView) {
          super(itemView);
          image= (ImageView) itemView.findViewById(R.id.image);
      }
     }
    }
  }
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  RecyclerView recyclerView;
  RecyclerViewAdapter adapter;
  File expath= Environment.getExternalStorageDirectory();
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      recyclerView= (RecyclerView) findViewById(R.id.recyclerview);
      adapter=new RecyclerViewAdapter(this, Photos.getPhotos(expath));
      recyclerView.setAdapter(adapter);
      recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2,StaggeredGridLayoutManager.VERTICAL));
     }
  }
  </code></pre>