Java 将我的数据从firebase数据库添加到我的列表视图时遇到问题

Java 将我的数据从firebase数据库添加到我的列表视图时遇到问题,java,Java,在我的firebase中,数据就像我添加的用户(男性、女性、学生、教师)下的数据一样,我希望所有数据都添加到列表视图中,但不添加任何数据 代码为: DatabaseReference studentdb=FirebaseDatabase.getInstance().getReference().child(“学生”); studentdb.addChildEventListener(新的ChildEventListener(){ @凌驾 public void onchildaded(@NonN

在我的firebase中,数据就像我添加的用户(男性、女性、学生、教师)下的数据一样,我希望所有数据都添加到列表视图中,但不添加任何数据

代码为:

DatabaseReference studentdb=FirebaseDatabase.getInstance().getReference().child(“学生”);
studentdb.addChildEventListener(新的ChildEventListener(){
@凌驾
public void onchildaded(@NonNull DataSnapshot snapshot snapshot,@null字符串previous){
if(snapshot.exists()){
//userdb=userdb.child(“学生”);
卡片项目=新卡片(snapshot.getKey()、snapshot.child(“名称”).getValue().toString());
行项目。添加(项目);
arrayAdapter.notifyDataSetChanged();
}
}
@凌驾
public void onChildChanged(@NonNull DataSnapshot快照,@null字符串previous){
arrayAdapter.notifyDataSetChanged();
}
@凌驾
公共void onChildRemoved(@NonNull DataSnapshot snapshot snapshot){
}
@凌驾
public void onChildMoved(@NonNull DataSnapshot snapshot snapshot,@null字符串previous){
}
@凌驾
已取消公共void(@NonNull DatabaseError){
}
});