title: Android recycle view in fragment not working
body: <p><strong>My Adapter</strong></p>
  
  <pre><code>public class DepartmentsAdapter extends RecyclerView.Adapter&lt;DepartmentsAdapter.ViewHolder&gt;{
  
  // Store a member variable for the contacts
  private List&lt;AppDepartments&gt; mDepartments;
  // Store the context for easy access
  private Context mContext;
  
  
  @Override
  public DepartmentsAdapter.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.app_department_item, parent, false);
      // Return a new holder instance
      ViewHolder viewHolder = new ViewHolder(contactView);
      return viewHolder;
  }
  
  // Involves populating data into the item through holder
  @Override
  public void onBindViewHolder(DepartmentsAdapter.ViewHolder holder, int position) {
      AppDepartments appDepartments = mDepartments.get(position);
      // Set item views based on your views and data model
     /* holder.txtViewName.setText(appDepartments.getDeptName());
      holder.txtViewUser.setText(appDepartments.getDeptUser());*/
      holder.txtViewName.setText("HELLO");
      holder.txtViewUser.setText("ITS VICTOR");
  
  }
  
  @Override
  public long getItemId(int i) {
      return 0;
  }
  
  @Override
  public int getItemCount() {
      return 0;
  }
  </code></pre>
  
  <p><strong>My Fragment</strong></p>
  
  <pre><code>public class DiscoverFragment extends Fragment {
  
  public DiscoverFragment() {
      // Required empty public constructor
  }
  
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      // Inflate the layout for this fragment
      View rootView =  inflater.inflate(R.layout.fragment_discover, container, false);
      departmentsAdapter = new DepartmentsAdapter(getActivity(),departList);
      // Lookup the recyclerview in activity layout
      RecyclerView displayDeparts = (RecyclerView) rootView.findViewById(R.id.appDepartments);
      displayDeparts.setAdapter(departmentsAdapter);
      displayDeparts.setLayoutManager(new LinearLayoutManager(getActivity()));
      // Inflate the layout for this fragment
      return rootView;
  }
  
  @Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
  
  }
  
  @Override
  public void onAttach(Context context) {
      super.onAttach(context);
      if (context instanceof OnFragmentInteractionListener) {
          mListener = (OnFragmentInteractionListener) context;
      } else {
          throw new RuntimeException(context.toString()
                  + " must implement OnFragmentInteractionListener");
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The above code returns a blank screen,the textviews are not displayed. Kindly help.
  I have commented out the model so that i can test with hard coded texts.
  I was following this post <a href="http://guides.codepath.com/android/Using-the-RecyclerView" rel="nofollow noreferrer">http://guides.codepath.com/android/Using-the-RecyclerView</a></p>