0

I want to display data in firebaseRecyclerAdapter where I have two queries returning true but I'm able to do for one.

adapterArchive = new FirebaseRecyclerAdapter<Bill, BillViewHolder>(Bill.class,
                    R.layout.bill_item,
                    BillViewHolder.class,
                    bill.orderByChild("date").startAt(startDate).endAt(endDate)) {
                @Override
                protected void populateViewHolder(BillViewHolder viewHolder, Bill model, int position) {


                    viewHolder.txtBillNumber.setText("Number :  " + model.getNumber());

I want to display data which lie in the given date and in populateViewHolder I want to display only for(model.getStatus() == 6). but it's not happening. Please help me out with this

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Arpit Gupta
  • 113
  • 1
  • 6
  • 1
    Firebase Database queries can only order/filter on a single property. In many cases it is possible to combine the values you want to filter on into a single (synthetic) property. For an example of this and other approaches, see my answer here: http://stackoverflow.com/questions/26700924/query-based-on-multiple-where-clauses-in-firebase – Frank van Puffelen Mar 04 '18 at 21:19
  • As frank's comment, I would [fan-out](https://hackernoon.com/firebase-server-side-fan-out-722e825a05fb) original 'Bill' data to another path. It will be like this -> 'bill-status-6'. Or you could migrate to [Cloud Firestore](https://firebase.google.com/docs/firestore/) which allow multiple queries. – wonsuc Mar 04 '18 at 22:09

0 Answers0