Lets say i have two model classes.
class School {
ArrayList<Students> students;
public ArrayList<Students> getStudents() {
return students;
}
}
class Students {
String studentName;
public String getStudent() {
return studentName;
}
}
How would i go by retrieving the students? I've tried this, but it does not work.
mRef.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
School s1 = datasnapshot.getValue(School.class)
s1.getStudents();
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});