In Firebase Realtime Database I want to show the user the list of orders that has been placed and for that, I need to get all the child that is created in Order Along with the it's value.
This is the code I have done so far
FirebaseDatabase.getInstance().getReference().child("Users").child("Customer").child(userID).child("Order").addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
Users usersnapshot = snapshot.getValue(Users.class);
if(usersnapshot!=null){
mCustomerinfo.setVisibility(View.VISIBLE);
Map<String, Object> map = (Map<String, Object>) snapshot.getValue();
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
}
});
}
public void Item( Map<String,Object> map){
// TODO:To check all the item in order and show it to the user
}
