This won't work because you need to go one level deeper, there is one more child that I unknown how you create it
ref2=db.getReference("HiringWalker").child(FirebaseAuth.getInstance().getCurrentUser().getUid());
Do this instead
ref2=db.getReference("HiringWalker").child("ciu12tcL4RfzmC3T6Gdp64LgiZa2").child(FirebaseAuth.getInstance().getCurrentUser().getUid());
Check where are you creating this ciu12tcL4RfzmC3T6Gdp64LgiZa2
and replace that .child("ciu12tcL4RfzmC3T6Gdp64LgiZa2")
with the current implementation that generates that random number
Your query is correct, but the fetch data is incorrect, should be modified from
ref2.addValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
infoList.clear();
for (DataSnapshot infoSnapshot : dataSnapshot.getChildren())
{
for (DataSnapshot infomationsnap : infoSnapshot.getChildren())
{
ReWalker rewalker = infomationsnap.getValue(ReWalker.class)
infoList.add(rewalker);
}
}
});
to
ref2.addValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
infoList.clear();
for (DataSnapshot infoSnapshot : dataSnapshot.getChildren())
{
ReWalker rewalker = infoSnapshot.getValue(ReWalker.class)
infoList.add(rewalker);
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.