title: Recycler View Not Showing Anything
body: <p>I have been making an app that uses a RecyclerView but its not showing any thing..why contents of the recycler view have not been showing up.my codes are bellow</p>
  
  <p>item_contact.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"
      android:paddingBottom="10dp"
      android:paddingTop="10dp"&gt;
  
      &lt;TextView
          android:id="@+id/contact_name"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1" /&gt;
  
      &lt;Button
          android:id="@+id/message_button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:paddingLeft="16dp"
          android:paddingRight="16dp"
          android:textSize="10sp" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>ContactsAdaptor.java</p>
  
  <pre><code>import android.content.Context;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.TextView;
  
  import java.util.List;
  public class ContactsAdapter extends RecyclerView.Adapter&lt;ContactsAdapter.ViewHolder&gt; {
  
      private List&lt;Contact&gt; mContacts;
      public ContactsAdapter(List&lt;Contact&gt; contacts) {
          mContacts = contacts;
      }
  
      @Override
      public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          Context context = parent.getContext();
          LayoutInflater inflater = LayoutInflater.from(context);
          View contactView = inflater.inflate(R.layout.item_contact, parent, false);
          ViewHolder viewHolder = new ViewHolder(contactView);
          return viewHolder;
      }
  
      @Override
      public void onBindViewHolder(ViewHolder viewHolder, int position) {
          Contact contact = mContacts.get(position);
  
          TextView textView = viewHolder.nameTextView;
          textView.setText(contact.getName());
  
          Button button = viewHolder.messageButton;
  
          if (contact.isOnline()) {
              button.setText("Message");
              button.setEnabled(true);
          } else {
              button.setText("Offline");
              button.setEnabled(false);
          }
      }
  
      @Override
      public int getItemCount() {
          return mContacts.size();
      }
      public static class ViewHolder extends RecyclerView.ViewHolder {
          public TextView nameTextView;
          public Button messageButton;
          public ViewHolder(View itemView) {
              super(itemView);
              nameTextView = (TextView) itemView.findViewById(R.id.contact_name);
              messageButton = (Button) itemView.findViewById(R.id.message_button);
          }
      }
  }
  </code></pre>
  
  <p>Contact.java</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  public class Contact {
      private String mName;
      private boolean mOnline;
  
      public Contact(String name, boolean online) {
          mName = name;
          mOnline = online;
      }
  
      public String getName() {
          return mName;
      }
  
      public boolean isOnline() {
          return mOnline;
      }
  
      private static int lastContactId = 0;
  
      public static List&lt;Contact&gt; createContactsList(int numContacts) {
          List&lt;Contact&gt; contacts = new ArrayList&lt;Contact&gt;();
  
          for (int i = 1; i &lt;= numContacts; i++) {
              contacts.add(new Contact("Person " + ++lastContactId, i &lt;= numContacts / 2));
          }
  
          return contacts;
      }
  }
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.fragment_home, container, false);
      RecyclerView rvContacts = (RecyclerView) rootView.findViewById(R.id.view);
      ContactsAdapter adapter = new ContactsAdapter(Contact.createContactsList(20));
      rvContacts.setAdapter(adapter);
      rvContacts.setLayoutManager(new LinearLayoutManager(getContext()));
  </code></pre>
  
  <p>please help me</p>