答案 0 :(得分:3)
试试这个:
mRef.child("1").addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(dataSnapshot.child("club").getValue().toString());
stringBuilder.append(dataSnapshot.child("name").getValue().toString());
stringBuilder.append(dataSnapshot.child("number").getValue().toString());
myTextView.setText(stringBuilder);
//or
//myTextView.append(dataSnapshot.child("club").getValue().toString());
//myTextView.append(dataSnapshot.child("name").getValue().toString());
//myTextView.append(dataSnapshot.child("number").getValue().toString());
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});