title: Firebase Storage Image Retrieve RecyclerView
body: <p>I'm trying to retrieve a firebase storage filled with images: </p>
  
  <p><a href="https://i.stack.imgur.com/9mNCs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9mNCs.png" alt="enter image description here"></a></p>
  
  <p>These images should be able to fill my recyclerviews, here is the code I have, I'm using Glide to load my images( I have the MyGlideAppModule set up correctly): </p>
  
  <pre><code>public class PicturesAdapter extends RecyclerView.Adapter&lt;PictureViewHolder&gt;
  {
      private List&lt;Pictures&gt; pictureList;
      private StorageReference mStorageRef;
  
  
      public PicturesAdapter(List&lt;Pictures&gt; pictureList)
      {
          this.pictureList = pictureList;
      }
  
      @NonNull
      @Override
      public PictureViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
      {
          View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.picture_cv,
                  parent, false);
  
  
          return new PictureViewHolder(itemView);
      }
  
      @Override
      public void onBindViewHolder(@NonNull PictureViewHolder holder, int position)
      {
          Pictures pi = pictureList.get(position);
          FirebaseStorage storage = FirebaseStorage.getInstance();
  
          mStorageRef = storage.getReference();
  
          GlideApp.with(holder.itemView.getContext())
                  .load(mStorageRef)
                  .into(holder.picture);
      }
  
      @Override
      public int getItemCount() {
          return pictureList.size();
      }
  }
  </code></pre>
  
  <p>My view holder class: </p>
  
  <pre><code>public class PictureViewHolder extends RecyclerView.ViewHolder
  {
      public ImageView picture;
  
  
      public PictureViewHolder(@NonNull View itemView)
      {
          super(itemView);
  
          picture = (ImageView) itemView.findViewById(R.id.bobbyBrown);
      }
  
  
      public ImageView getPictureContents()
      {
          return picture;
      }
  }
  </code></pre>
  
  <p>And before I was adding images to firebase, I had each image locally stored and I would call the adapter as follows: </p>
  
  <pre><code>public class PicturesFragment extends Fragment {
  
  
      private List&lt;Pictures&gt; pics = null;
      private RecyclerView mRecyclerView;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          View v = inflater.inflate(R.layout.fragment_pictures, container, false);
  
          initializeView();
  
          mRecyclerView = (RecyclerView) v.findViewById(R.id.picList);
          mRecyclerView.setHasFixedSize(true);
          PicturesAdapter p2 = new PicturesAdapter(pics);
  
          LinearLayoutManager llm = new LinearLayoutManager(v.getContext());
          llm.setOrientation(LinearLayoutManager.VERTICAL);
          mRecyclerView.setLayoutManager(llm);
          mRecyclerView.setAdapter(p2);
  
  
          // Inflate the layout for this fragment
          return v;
      }
  
      private void initializeView()
      {
          pics = new ArrayList&lt;Pictures&gt;();
          pics.add(new Pictures(R.drawable.firepit1_a));
          pics.add(new Pictures(R.drawable.firepit2_a));
          pics.add(new Pictures(R.drawable.firepit3_a));
          pics.add(new Pictures(R.drawable.firepit4_a));
          pics.add(new Pictures(R.drawable.firepit5_a));
          pics.add(new Pictures(R.drawable.firepit6_a));
          pics.add(new Pictures(R.drawable.pic1));
          pics.add(new Pictures(R.drawable.pic2));
          pics.add(new Pictures(R.drawable.pic3));
          pics.add(new Pictures(R.drawable.pic4));
          pics.add(new Pictures(R.drawable.pic5));
          pics.add(new Pictures(R.drawable.pic6));
          pics.add(new Pictures(R.drawable.pic7));
          pics.add(new Pictures(R.drawable.pic8));
      }
  }
  </code></pre>
  
  <p>How do I go about retrieving the images and filling them inside my adapter, any links to tutorials would be greatly appreciated, I haven't been able to find any yet. </p>
  
  <p>Thanks</p>