I have the following structure
root
-class1
-section1
-student1
-firstname
-lastname
-student2
-firstname
-lastname
-section2
-student1
-firstname
-lastname
-student2
-firstname
-lastname
I need to get the section number (Section1, section2...) and for every section, the lastname for student2.
The problem that i facing is that it is all in a Fragment class in android that I need to display and nothing seems to be working. I have referred this for getting the children too, but the for loop somehow does not work and I get Null values on retrieval.
I need to get
section1, lastname (of student2 in section1)
section2, lastname (of student2 in section2)
...
and so on until all sections are exhausted