更新时间:2022-02-14 22:27:46
这将有助于了解您实际如何处理 onDataChange
中的数据.但我的猜测是你没有遍历孩子:
It would help to see how you actually handle the data in onDataChange
. But my guess is that you're failing to loop over the children:
mDatabase
.child("projects")
.orderByChild("dateAdded")
.addValueEventListener(new ValueEventListener() {
public void onDataChange(DataSnapshot snapshot) {
for (DataSnapshot child: snapshot.getChildren()) {
System.out.println(child.getKey());
}
}
...