我想获得NomDirection,但它不适合我,任何帮助plzzz?!!
Fdatabase = FirebaseDatabase.getInstance().getReference().child("Fondation").child("Directions");
Fdatabase.orderByChild("NomDirection").addValueEventListener(new com.google.firebase.database.ValueEventListener() {
@Override
public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
//final List<String> etab = new ArrayList<String>();
for (DataSnapshot child : dataSnapshot.getChildren()) {
namedirection = (String) child.child("NomDirection").getValue();
// etab.add(namedirection);
Toast.makeText(testFondation.this,namedirection,Toast.LENGTH_SHORT).show();
}
}
答案 0 :(得分:1)
您必须使用.getReference().child("Fondation").child("-KrjG...").child("Directions")
。
最好看.getReference("Fondation/-KrjG.../Directions)
。
因此,您需要将在您的案例中以“KrjG ...”开头的密钥插入查询中。