'information of the user doesn't show in recyclerview in getting a specific value in a collection if firestore

I'm working on a project where a user sends his/her order and the admin will receive it in order to prepare the said order to deliver it.

Problem

I'm having trouble fetching the data on the admin side when receiving the said order from the customer

For some reason, only the time of the order appeared in the RecyclerView and the rest doesn't appear.

enter image description here

This is how it should appear if it works

enter image description here

I did the model and adapter right so I assume that the problem came to the recyclerview codes and I receive no error in the LogCat

     userOrderAdminRec = findViewById(R.id.admin_order_rcv);
        userOrderAdminRec.setLayoutManager(new LinearLayoutManager(this,RecyclerView.VERTICAL,false));
        adminUserDetailModelList = new ArrayList<>();
        adminUserDetailAdapter = new AdminUserDetailAdapter(this,adminUserDetailModelList);
        userOrderAdminRec.setAdapter(adminUserDetailAdapter);

        firestore.collection("UserOrder")
                .get()
                .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
                    @Override
                    public void onComplete(@NonNull Task<QuerySnapshot> task) {
                        if (task.isSuccessful()){
                            for (QueryDocumentSnapshot documentSnapshot : task.getResult()){

                                AdminUserDetailModel adminUserDetailModel = documentSnapshot.toObject(AdminUserDetailModel.class);
                                adminUserDetailModelList.add(adminUserDetailModel);
                                adminUserDetailAdapter.notifyDataSetChanged();

                            }
                        }
                        else {

                            Toast.makeText(AdminOrderActivity.this, "Error"+task.getException(), Toast.LENGTH_SHORT).show();
                        }
                    }
                });



    }
    private void orderList() {
      

        FirebaseFirestore db = FirebaseFirestore.getInstance();
        CollectionReference userCartOrder = db.collection("UserOrder").document().collection("CartID");
        CollectionReference userCartID = db.collection("ItemOrder");

        Query query = userCartID.whereEqualTo("CartID",userCartOrder);

        query.get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
            @Override
            public void onComplete(@NonNull Task<QuerySnapshot> task) {
                if (task.isSuccessful()){
                    for (QueryDocumentSnapshot documentSnapshot: task.getResult()){
                        AdminUserDetailModel adminUserDetailModel = documentSnapshot.toObject(AdminUserDetailModel.class);
                        adminUserDetailModelList.add(adminUserDetailModel);
                    }
                    adminUserDetailAdapter.notifyDataSetChanged();
                }
                else {
                    Toast.makeText(AdminOrderActivity.this, "Query failed", Toast.LENGTH_SHORT).show();
                }
            }
        });

this is my collection in the firestore if it's needed

enter image description here

enter image description here

AdminUserDetailModel

public class AdminUserDetailModel {

    String name;
    String address;
    String phoneNumber;
    String cartID;
    String totalPrice;
    String currentTime;
    String itemList;
    String productName;
    String productQuantity;

    public AdminUserDetailModel() {
    }

    public AdminUserDetailModel(String name,String productName,String productQuantity, String address, String phoneNumber, String cartID, String totalPrice, String currentTime, String itemList) {
        this.name = name;
        this.address = address;
        this.phoneNumber = phoneNumber;
        this.cartID = cartID;
        this.totalPrice = totalPrice;
        this.currentTime = currentTime;
        this.itemList = itemList;
        this.productName = productName;
        this.productQuantity = productQuantity;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getCartID() {
        return cartID;
    }

    public void setCartID(String cartID) {
        this.cartID = cartID;
    }

    public String getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(String totalPrice) {
        this.totalPrice = totalPrice;
    }

    public String getCurrentTime() {
        return currentTime;
    }

    public void setCurrentTime(String currentTime) {
        this.currentTime = currentTime;
    }

    public String getItemList() {
        return itemList;
    }

    public void setItemList(String itemList) {
        this.itemList = itemList;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductQuantity() {
        return productQuantity;
    }

    public void setProductQuantity(String productQuantity) {
        this.productQuantity = productQuantity;
    }
}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source