firebaseDatabase = FirebaseDatabase.getInstance();
assert post_id != null;
DatabaseReference database = firebaseDatabase.getReference().child("RegisteredTrips").child(post_id).child("Customer");
database.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
ArrayList data = new ArrayList<>();
for (DataSnapshot noteDataSnapshot : dataSnapshot.getChildren()) {
assert noteDataSnapshot != null;
Customer value = noteDataSnapshot.getValue(Customer.class);
data.add(value);
}
mListadapter = new ListAdapter(data);
mRecyclerView.setAdapter(mListadapter);
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
this is my firebase data tree