答案 0 :(得分:1)
使用此代码
String currentUser = FirebaseAuth.getInstance().getCurrentUser().getUid();
DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child("users").child(currentUser);
ref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
String snap_user = dataSnapshot.child("Snapchat").child("username").toString();
String twiter_user = dataSnapshot.child("twiter").child("username").toString();
}
@Override
public void onCancelled(DatabaseError databaseError) {
throw databaseError.toException(); // Don't ignore errors
}
});