In my firebase database the date is the key value (node) which has its own children. How to retrieve the date into firebase adapter and show it in the listview? I am using the below code but the list is blank.
databaseReference = FirebaseDatabase.getInstance().getReference().child("Lectures").child(post_key);
FirebaseListOptions<String> options = new FirebaseListOptions.Builder<String>()
.setLayout(R.layout.subject_list_heading)
.setQuery(databaseReference, String.class)
.build();
adapter = new FirebaseListAdapter<String>(options) {
@Override
protected void populateView(View v, String model, int position) {
TextView subject_name = v.findViewById(R.id.tv_sub_heading);
subject_name.setText(model);
}
};
list_of_date.setAdapter(adapter);
This is the JSON object:
{
"-LHSdSCzD_tZhzqvSOw_" : {
"17-7-2018" : {
"Absent" : "0",
"Present" : "1",
"Total_Lectures" : "1"
}
I want to retrieve the date in the listview. Any help is appreciated.