0

enter image description here

I am trying to load this hashmap in the picture ,I tried this but it didn't work

 referenceC= FirebaseDatabase.getInstance().getReference("Clas" +
            "ses").child(classId);


     referenceC.child("comment").child(postId).addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
            comments.size();

            comments.clear();
          
                for (DataSnapshot ds : dataSnapshot.getChildren()) {
                    if (ds.exists()) {

                ModelComment model = ds.getValue(ModelComment.class);

                    comments.add(model);

                    }
                }}
Frank van Puffelen
  • 499,950
  • 69
  • 739
  • 734
Sakina aa
  • 1
  • 1

0 Answers0