1
I need to fetch the red highlighted values in the image, but I only know the blue highlighted item.
I tried that way:
firebase = ConfiguracaoFirebase.getFirebase().child("tb_contato").child(identificador);
valueEventListener = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot filho: dataSnapshot.getChildren())
{
Contato contato = filho.getValue(Contato.class);
Log.i("Teste","Teste");
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
};
firebase.addListenerForSingleValueEvent(valueEventListener);
Where the "identifier" is the blue underlined value of the image.
From what you put in the question, your bank seems to be poorly structured, it is better to avoid nesting data as much as possible. The only way I see it is to loop the keys, save in an array and use it to access the child data
– Costamilam