title: RecyclerView not showing items inside view pager fragment
body: <p>When I click the chat tab the recycler view doesn't show the items inside the fragment. It was working before when I had it in a activity. Now it doesnt seem to show the items when running the app. I have tried debugging and the likes and still can't seem to find out the problem. Any help will be grateful, thanks!</p>
  
  <p>ChatFragment.java</p>
  
  <pre><code>package com.swampass.nauticalapp;
  
  import android.app.Activity;
  import android.content.Context;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.database.DataSnapshot;
  import com.google.firebase.database.DatabaseError;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.database.ValueEventListener;
  import com.swampass.nauticalapp.model.ActiveChatConvo;
  import com.swampass.nauticalapp.model.User;
  
  import java.util.ArrayList;
  
  public class ChatsFragment extends Fragment {
  
      private RecyclerView recyclerView;
      private DatabaseReference mRef;
      private LinearLayoutManager mLinearLayoutManager;
      private ArrayList&lt;User&gt; users;
      private FirebaseAuth mAuth;
      private ActiveChatConvo adapter;
  
      public ChatsFragment() {
          // Required empty public constructor
      }
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
      {
          View penis = inflater.inflate(R.layout.fragment_chats, container, false);
  
          // Inflate the layout for this fragment
          mRef = FirebaseDatabase.getInstance().getReference("Users");
          mRef.keepSynced(true);
  
          mAuth = FirebaseAuth.getInstance();
  
          users = new ArrayList&lt;&gt;();
          adapter = new ActiveChatConvo(users,getContext());
  
          mRef.addListenerForSingleValueEvent(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  if (dataSnapshot.exists())
                  {
                      for (DataSnapshot postSnapshot: dataSnapshot.getChildren())
                      {
                          String name = postSnapshot.child("Name").getValue(String.class);
                          String email = postSnapshot.child("Email").getValue(String.class);
                          String pic = postSnapshot.child("image").getValue(String.class);
  
                          users.add(new User(name,email,pic));
  
                      }
  
                      adapter.notifyDataSetChanged();
              }
  
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
              }
          });
  
          //Recycler View
          recyclerView = (RecyclerView) penis.findViewById(R.id.active_chats);
          //ActiveChatConvo adapter = new ActiveChatConvo(users,this);
          Context c = getContext();
          mLinearLayoutManager = new LinearLayoutManager(getActivity());
          //mLinearLayoutManager.setStackFromEnd(true);
          recyclerView.setLayoutManager(mLinearLayoutManager);
  
          recyclerView.setAdapter(adapter);
          //adapter.notifyDataSetChanged();
  
          return inflater.inflate(R.layout.fragment_chats, container, false);
      }
  
  }
  </code></pre>
  
  <p>ActiveChatConvo.java</p>
  
  <pre><code>package com.swampass.nauticalapp.model;
  
  import android.content.Context;
  import android.content.Intent;
  import android.net.Uri;
  import android.support.v7.widget.RecyclerView;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.ImageView;
  import android.widget.LinearLayout;
  import android.widget.TextView;
  
  import com.google.firebase.database.DataSnapshot;
  import com.google.firebase.database.DatabaseError;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.ValueEventListener;
  import com.squareup.picasso.Picasso;
  import com.swampass.nauticalapp.ChatConversationActivity;
  import com.swampass.nauticalapp.R;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * Created by Peter on 6/6/2017.
   */
  
  public class ActiveChatConvo extends RecyclerView.Adapter&lt;ActiveChatConvo.ViewHolder&gt; {
      private ArrayList&lt;User&gt; mUsers;
      private Context mContext;
  
      public ActiveChatConvo(ArrayList&lt;User&gt; users, Context dick) {
          mUsers = users;
          mContext = dick;
      }
  
      private Context getContext() {
          return mContext;
      }
  
      @Override
      public ActiveChatConvo.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          Context context = parent.getContext();
          LayoutInflater inflater = LayoutInflater.from(context);
  
          // Inflate the custom layout
          View contactView = inflater.inflate(R.layout.chat_single_item, parent, false);
  
          // Return a new holder instance
          ViewHolder viewHolder = new ViewHolder(contactView);
          return viewHolder;
      }
  
      @Override
      public void onBindViewHolder(ViewHolder holder, int position) {
          // Get the data model based on position
          User user = mUsers.get(position);
  
          // Set item views based on your views and data model
          TextView name = holder.mItemName;
          name.setText(user.getName());
          TextView description = holder.mItemDescription;
          description.setText(user.getEmail());
          ImageView pic = holder.mItemImage;
          Picasso.with(pic.getContext()).load(Uri.parse(user.getPic())).into(pic);
  
      }
  
      @Override
      public int getItemCount() {
          return mUsers.size();
      }
  
      public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  
          private ImageView mItemImage;
          private TextView mItemName;
          private TextView mItemDescription;
          private LinearLayout layout;
          final LinearLayout.LayoutParams params;
  
          public ViewHolder(View v) {
              super(v);
  
              mItemImage = (ImageView) v.findViewById(R.id.chat_persion_image);
              mItemName = (TextView) v.findViewById(R.id.chat_persion_name);
              mItemDescription = (TextView) v.findViewById(R.id.chat_persion_email);
              layout = (LinearLayout) itemView.findViewById(R.id.show_chat_single_item_layout);
              params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
              v.setOnClickListener(this);
          }
  
          @Override
          public void onClick(View v) {
              Context context = itemView.getContext();
  
  
              Intent intent = new Intent(context, ChatConversationActivity.class);
              // intent.putExtra("image_id", );
              intent.putExtra("descripion", mItemDescription.getText().toString());
              intent.putExtra("name", mItemName.getText().toString());
  
              context.startActivity(intent);
          }
      }
  }
  </code></pre>
  
  <p>fragment_chat.xml</p>
  
  <pre><code>&lt;LinearLayout 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"
      android:orientation="vertical"
      tools:context="com.swampass.nauticalapp.ChatsFragment"&gt;
  
      &lt;!-- TODO: Update blank fragment layout --&gt;
      &lt;android.support.v7.widget.RecyclerView
  
          android:id="@+id/active_chats"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentBottom="true"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:background="@color/colorAccent"&gt;
  
  
      &lt;/android.support.v7.widget.RecyclerView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>