title: Display specific data from firebase inside Recycler view
body: <p>I have a tab layout inside one of my activity. Different tabs extends different fragments. I have to display data in <strong>cardView inside fragment</strong>.
  CardView will contain all  data of a single child inside <strong>Bills</strong>.</p>
  
  <p>This is the my activity</p>
  
  <p><a href="https://i.stack.imgur.com/zXEK2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zXEK2.png" alt="enter image description here"></a> </p>
  
  <p>This is how my database look like:<br>
  <a href="https://i.stack.imgur.com/4w68Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4w68Q.png" alt="enter image description here"></a></p>
  
  <p>Now the problem is instead of displaying data of  all child inside <strong>Bills</strong> node I need to filter them with two things <strong>1. userId</strong> and <strong>2. billType</strong>. Now if <strong>userId</strong> is matched with <strong>mUser.getUid()</strong> which is unique key of current user then it should check for <strong>billType</strong> suppose, if billType is Electronics then it should be visible inside electronics tab.</p>
  
  <p>This is code of my fragment view of viewElectronics.java</p>
  
  <pre><code>public class viewElectronics extends Fragment {
  
  private RecyclerView mReceipt;
  private FirebaseAuth mAuth;
  private FirebaseUser mUser;
  private DatabaseReference mRef;
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.electronics_layout, container, false);
      mAuth = FirebaseAuth.getInstance();
      mUser = mAuth.getCurrentUser();
      mRef = FirebaseDatabase.getInstance().getReference().child("Bills");
      mReceipt = (RecyclerView) rootView.findViewById(R.id.electronicsRecycler);
      mReceipt.setLayoutManager(new LinearLayoutManager(getContext()));
  
      FirebaseRecyclerAdapter&lt;DataModel, ReceiptViewHolder&gt; firebaseRecyclerAdapter = new FirebaseRecyclerAdapter&lt;DataModel, ReceiptViewHolder&gt;
              (DataModel.class, R.layout.reciept_row, ReceiptViewHolder.class, mRef){
          @Override
          protected void populateViewHolder(ReceiptViewHolder viewHolder, DataModel model, int position) {
              viewHolder.setBillNo("Bill No : " + model.getBillNo());
              viewHolder.setStoreName("Store Name : " + model.getCompany());
              viewHolder.setDate("Date : " + model.getDate());
              viewHolder.setTime("Time : " + model.getTime());
              viewHolder.setBillTotal("Total : " + model.getTotal());
          }
      };
  
      mReceipt.setAdapter(firebaseRecyclerAdapter);
      return rootView;
  
  }
  
  }
  </code></pre>
  
  <p>Suppose only last node is having <strong>billType: Electronics</strong> then, Electronics Tab should contain last card. What changes do I need in this code.
  Thanks in advance. Any help is appreciated.</p>