How To Retrieve Firebase Json Arraylist Inside Arraylist Data And Store It In Arraylist For Display In Textview Later
I want to retrieve data from fire-base to display later in Text View. but Data-snapshot is not getting all the key and value(i.e. date,month,year) only reaching to date . i need
Solution 1:
You are referencing the node purchasebill
, and then you are looping inside the direct children of purchasebill
which are gameworld
and datamination
.
To solve your problem, you can add a reference to child datamination
thus it won't loop inside gameworld
, so you can do the following:
myRef.child("datamination").addValueEventListener(new ValueEventListener() {
@Override
publicvoidonDataChange(@NonNull DataSnapshot dataSnapshot) {
billlistHelper = dataSnapshot.getValue(BilllistHelper.class);
assert billlistHelper != null;
account.add(billlistHelper.getAccount());
amount.add(billlistHelper.getAmount());
for (DataSnapshot dd : dataSnapshot.child("datedata").getChildren(){
dateDataHelper = dd.getValue(DateDataHelper.class);
date.add(dateDataHelper.getDate());
month.add(dateDataHelper.getMonth());
year.add(dateDataHelper.getYear());
}
intendby.add(billlistHelper.getIntendby());
vendorname.add(billlistHelper.getVendorName());
}
billListAdapter.notifyDataSetChanged();
}
Post a Comment for "How To Retrieve Firebase Json Arraylist Inside Arraylist Data And Store It In Arraylist For Display In Textview Later"