我有一个键,我想检索它的值。这是我的代码:
public void afterTextChanged(Editable editable) {
// String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();
//Query query = FirebaseDatabase.getInstance().getReference(uid).orderByChild("title").startAt(editable.toString()).endAt(editable.toString()+"\uf888");
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference("categoreis");
Query query = FirebaseDatabase.getInstance().getReference("categoreis").limitToFirst(4).orderByChild("image");
query.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
list.clear();
for (DataSnapshot data:dataSnapshot.getChildren())
{
for (DataSnapshot ds:data.child("SubAccessories").getChildren())
{
for (DataSnapshot ds1:ds.getChildren())
{
for (DataSnapshot vale:ds1.getChildren())
{
Log.d("check",vale.toString());
vale.getKey();`
}
}
}
}
}
}