title: RecyclerView not showing any images
body: <p>I'm implementing the RecyclerView in my app to display a list of images in a fragment. But whenever the fragments opens, the list remains empty, that is, no images are shown. What am I missing out on? I am relatively new to android, so go easy :p</p>
  
  <p>Also let me know if you want any other file.</p>
  
  <p>My Fragment:</p>
  
  <p>public class SponsorsFragment extends Fragment {</p>
  
  <pre><code>    public static int[] sponsorImageId = {
              R.drawable.apr,
              R.drawable.bigsandwich,
              R.drawable.bodal,
              R.drawable.brijeel
      };
      RecyclerView sponsorRecyclerView;
  
      public SponsorsFragment() {
          // Required empty public constructor
      }
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          View view = inflater.inflate(R.layout.fragment_sponsors, container, false);
  
          sponsorRecyclerView = (RecyclerView) view.findViewById(R.id.sponsor_recycler_view);
          ImageAdapter imageAdapter = new ImageAdapter(getActivity(), getImageData());
          sponsorRecyclerView.setAdapter(imageAdapter);
          sponsorRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
  
          return view;
      }
  
      public static List&lt;ImageId&gt; getImageData() {
          List&lt;ImageId&gt; data = new ArrayList&lt;&gt;();
          for (int i = 0; i &lt; sponsorImageId.length; i++) {
              ImageId current = new ImageId();
              current.id = sponsorImageId[i];
              data.add(current);
          }
          return data;
      }
  }
  </code></pre>
  
  <p>list_for_sponsors.xml:</p>
  
  <pre><code>&lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_height="wrap_content"
      android:layout_width="match_parent"&gt;
  
      &lt;ImageView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/image_for_sponsors"
          android:src="@drawable/brijeel"&gt;
      &lt;/ImageView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>ImageAdapter.java:</p>
  
  <pre><code>public class ImageAdapter extends RecyclerView.Adapter&lt;ImageAdapter.MyImageViewHolder&gt; {
  
      private LayoutInflater inflater;
      private Context context;
      private List&lt;ImageId&gt; images = Collections.emptyList();
  
      public ImageAdapter(Context c, List&lt;ImageId&gt; data) {
          context = c;
          inflater = LayoutInflater.from(context);
          images = data;
          Log.e("RecyclerView", "Error " + images.size());
  
      }
  
      @Override
      public MyImageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view = inflater.inflate(R.layout.list_for_sponsors, parent, false);
          MyImageViewHolder holder = new MyImageViewHolder(view);
          return holder;
      }
  
      @Override
      public int getItemCount() {
          return images.size();
      }
  
      @Override
      public void onBindViewHolder(MyImageViewHolder holder, int position) {
          ImageId current = images.get(position);
          Log.e("RecyclerView", "" + current.id);
          holder.imageView.setImageResource(current.id);
      }
  
      class MyImageViewHolder extends RecyclerView.ViewHolder{
          public ImageView imageView;
  
          public MyImageViewHolder(View view) {
              super(view);
              imageView = (ImageView) view.findViewById(R.id.image_for_sponsors);
          }
      }
  }
  </code></pre>
  
  <p>fragment.xml</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="in.djtrinity.www.trinity.AboutFragment"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginTop="8dp"
          android:id="@+id/sponsor_recycler_view"&gt;
  
      &lt;/android.support.v7.widget.RecyclerView&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>