title: android studio recyclerView with firestore
body: <p>I have orders collection in firestore:
  <img src="https://i.stack.imgur.com/COhkV.png" alt="enter image description here"></p>
  
  <p>And I have Sellers collection and inside Sellers collection have another Fruits collection :
  <img src="https://i.stack.imgur.com/wMxMx.png" alt="enter image description here"></p>
  
  <p>I want to get data in orders collection only orders collection fruit_ID equals Sellers/Fruits collection Document ID and add into recyclerview</p>
  
  <p>Is it possible? </p>
  
  <p>Activity class:</p>
  
  <pre><code>package com.example.freshbucket.Seller;
  
  import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.support.v7.widget.helper.ItemTouchHelper;
  import android.util.Log;
  import android.widget.Toast;
  
  import com.example.freshbucket.Adapter.OrdersSellerRecylerAdapter;
  import com.example.freshbucket.Model.PlaceOrder;
  import com.example.freshbucket.R;
  import com.firebase.ui.firestore.FirestoreRecyclerOptions;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.firestore.CollectionReference;
  import com.google.firebase.firestore.DocumentSnapshot;
  import com.google.firebase.firestore.EventListener;
  import com.google.firebase.firestore.FirebaseFirestore;
  import com.google.firebase.firestore.FirebaseFirestoreException;
  import com.google.firebase.firestore.Query;
  import com.google.firebase.firestore.QuerySnapshot;
  
  import javax.annotation.Nullable;
  
  import static android.support.constraint.Constraints.TAG;
  
  public class SellerGetOrdersActivity extends AppCompatActivity {
  
      String fid, pro;
  
     private FirebaseAuth mAuth = FirebaseAuth.getInstance();
      String user_id = mAuth.getCurrentUser().getUid();
  
      private FirebaseFirestore db = FirebaseFirestore.getInstance();
      private CollectionReference orders = db.collection("Orders");
      private CollectionReference sellers = db.collection("Sellers/"+user_id+"/Fruits");
  
      private OrdersSellerRecylerAdapter adapter;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_seller_get_orders);
  
          setupRecyclerView();
  
      }
  
      private void setupRecyclerView()
      {
  
          Query query =orders.orderBy("timestamp", Query.Direction.DESCENDING).whereEqualTo("fruit_ID",fid);
  
          FirestoreRecyclerOptions&lt;PlaceOrder&gt; options = new FirestoreRecyclerOptions.Builder&lt;PlaceOrder&gt;().setQuery(query, PlaceOrder.class).build();
  
          adapter = new OrdersSellerRecylerAdapter(options);
  
          RecyclerView recyclerView = findViewById(R.id.ordersReView);
          recyclerView.setHasFixedSize(true);
          recyclerView.setLayoutManager(new LinearLayoutManager(this));
  
  
  
          recyclerView.setAdapter(adapter);
  
          //swipe delete
          new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT| ItemTouchHelper.RIGHT) {
              @Override
              public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder viewHolder1) {
                  return false;
              }
  
              @Override
              public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int i) {
                  adapter.deleteItem(viewHolder.getAdapterPosition());
  
              }
          }).attachToRecyclerView(recyclerView);
  
      }
  
  
  
      @Override
      protected void onStart() {
          super.onStart();
          adapter.startListening();
  
  
  
         sellers.addSnapshotListener(new EventListener&lt;QuerySnapshot&gt;() {
              @Override
              public void onEvent(@Nullable QuerySnapshot queryDocumentSnapshots, @Nullable FirebaseFirestoreException e) {
  
  
  
                  if (e != null) {
                      Log.d(TAG, "Error:" + e.getMessage());
                  } else {
  
                      for (DocumentSnapshot doc :queryDocumentSnapshots){
  
                          fid = doc.getId();
  
                         // pro = doc.getString("province");
                         // fid = doc.getString("fruit_ID");
                          Toast.makeText(SellerGetOrdersActivity.this, "Register error:" +fid , Toast.LENGTH_SHORT).show();
  
  
                                 }
  
  
  
                  }
  
              }
          });
  
  
  
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          adapter.stopListening();
      }
    }
  </code></pre>
  
  <p>Adapter:</p>
  
  <pre><code>    package com.example.freshbucket.Adapter;
  
  import android.content.Context;
  import android.support.annotation.NonNull;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.EditText;
  import android.widget.TextView;
  
  import com.example.freshbucket.Model.PlaceOrder;
  import com.example.freshbucket.R;
  import com.firebase.ui.firestore.FirestoreRecyclerAdapter;
  import com.firebase.ui.firestore.FirestoreRecyclerOptions;
  
  public class OrdersSellerRecylerAdapter extends FirestoreRecyclerAdapter&lt;PlaceOrder, OrdersSellerRecylerAdapter.OrdersSellerHolder&gt; {
  
      Context context;
  
  
      public OrdersSellerRecylerAdapter(@NonNull FirestoreRecyclerOptions&lt;PlaceOrder&gt; options) {
          super(options);
      }
  
      @Override
      protected void onBindViewHolder(@NonNull final OrdersSellerHolder holder, int position, @NonNull final PlaceOrder model) {
  
         holder.txtfruitname.setText(model.getName());
         holder.txtqun.setText(model.getQun());
         holder.txtcusname.setText(model.getCustomer_Name());
          holder.txtaddress1.setText(model.getAddressLine1());
          holder.txtaddress2.setText(model.getAddressLine2());
          holder.txtcity.setText(model.getCity());
  
  
      }
  
      @NonNull
      @Override
      public OrdersSellerHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
  
          View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.order_list_item_seller,viewGroup, false);
          context = viewGroup.getContext();
  
  
          return new OrdersSellerHolder(v);
      }
  
  
      class OrdersSellerHolder extends RecyclerView.ViewHolder{
  
         TextView txtfruitname, txtqun, txtcusname, txtaddress1, txtaddress2, txtcity;
         EditText tctBprice;
  
  
          public OrdersSellerHolder(@NonNull View itemView) {
              super(itemView);
  
              txtfruitname = itemView.findViewById(R.id.fruitnametext);
              txtqun = itemView.findViewById(R.id.fruitquntext);
              txtcusname = itemView.findViewById(R.id.cusnametext);
              txtaddress1 = itemView.findViewById(R.id.addres1text);
              txtaddress2 = itemView.findViewById(R.id.addres2text);
              txtcity = itemView.findViewById(R.id.citytext);
  
  
          }
  
  
      }
  
      public void deleteItem(int position) {
          getSnapshots().getSnapshot(position).getReference().delete();
      }
  
  
  
  
  }
  </code></pre>