title: Only one item displaying in recycler view
body: <p>I am having problems displaying all the items in my recyclerview. My code only shows one item (Home. I have 3 items: Home, Browse Photos and My Travels)</p>
  
  <p>fragment_navigation_drawer.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/fragment_navigation_drawer"
      android:background="#EEE"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.traveldiaries.ztir.traveldiaries.NavigationDrawerFragment"&gt;
  
      &lt;!-- TODO: Update blank fragment layout --&gt;
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="220dp"
          android:background="#16a085"
          android:id="@+id/linearLayout"&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/drawerList"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"&gt;
      &lt;/android.support.v7.widget.RecyclerView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>RecyclerAdapter.java</p>
  
  <pre><code>public class RecyclerAdapter extends RecyclerView.Adapter&lt;RecyclerAdapter.MyViewHolder&gt; {
      private LayoutInflater inflater;
      List&lt;MenuList&gt; data = Collections.emptyList();
  
      public RecyclerAdapter(Context context, List&lt;MenuList&gt; data){
          inflater= LayoutInflater.from(context);
          this.data = data;
      }
  
      @Override
      public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view=inflater.inflate(R.layout.itemlist,parent,false);
          MyViewHolder holder= new MyViewHolder(view);
          return holder;
      }
  
      @Override
      public void onBindViewHolder(MyViewHolder holder, int position) {
          MenuList current=data.get(position);
          holder.title.setText(current.title);
          holder.image.setImageResource(current.icon);
      }
  
      @Override
      public int getItemCount() {
          return data.size();
      }
      class MyViewHolder extends RecyclerView.ViewHolder{
          TextView title;
          ImageView image;
          public MyViewHolder(View itemView) {
              super(itemView);
              title = (TextView) itemView.findViewById(R.id.item_list);
              image =  (ImageView) itemView.findViewById(R.id.icons);
          }
      }
  }
  </code></pre>
  
  <p>NavigationDrawerFragment.java (posted code only related to recyclerview)</p>
  
  <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      View layout = inflater.inflate(R.layout.fragment_navigation_drawer, container, false);
      recyclerView = (RecyclerView) layout.findViewById(R.id.drawerList);
      adapter = new RecyclerAdapter(getActivity(),getData());
      recyclerView.setAdapter(adapter);
      recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
      return layout;
  }
  
  public static List&lt;MenuList&gt; getData(){
      List&lt;MenuList&gt; data = new ArrayList&lt;&gt;();
      String[] titles={"Home","My Travels","Browse Photos"};
      int[] icons ={R.drawable.home,R.drawable.sunglasses,R.drawable.tooltip_image};
  
      for(int i=0;i&lt;3;i++){
          MenuList current = new MenuList();
          current.title=titles[i];
          current.icon=icons[i];
          Log.d("Data",titles[i]);
          Log.d("Data",""+icons[i]);
          data.add(current);
      }
      return data;
  }
  </code></pre>
  
  <p>itemlist.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;ImageView
          android:padding="8dp"
          android:id="@+id/icons"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:src="@drawable/ic_menu_camera"
          android:layout_gravity="center_vertical"
          /&gt;
  
      &lt;TextView
          android:id="@+id/item_list"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Dummy Text"
          android:layout_gravity="center_vertical"
          android:padding="8dp"
          /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>What I was able to do is to check all the passed data (all seems to be fine). Also tried to change width to wrap content (fragment_navigation_drawer.xml) in both my relative and linear layout but I just lose my background color instead and still only one item appear.</p>