КЛАСС
public class Account {
String desc;
List<ObjXXX> listObjXXX = new ArrayList<>();
МАГАЗИН
DatabaseReference newPostRef = dbRef1.push();
String child = newPostRef.getKey();
Account item = new Account("XXX", listObj);
newPostRef.setValue(item);
GET
Query query = FirebaseDatabase.getInstance().getReference().child(child);
ValueEventListener postListener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// Get Post object and use the values to update the UI
Account account = (Account) dataSnapshot.getValue(Account.class);
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
};
query.addListenerForSingleValueEvent(postListener);