I need to recover all users within a user node, following firebase structure:
FormetoretrievethesevaluesI'mmakinganaddListenerForSingleValueEvent,followscode:
privateDatabaseReferencefirebaseRef;privateDataSnapshotusuariosSnapshot;firebaseRef=ConfiguracaoFirebase.getFirebase();//recuperarusuariosparacriaçãodofeednahoradapostagemDatabaseReferenceusuariosRef=firebaseRef.child("usuarios");
usuariosRef.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
usuariosSnapshot = dataSnapshot;
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
postagemPendente.salvar(usuariosSnapshot);
Even if the reference is pointing to the right place, the userSnapshot still shows as null, what do I have to do to get all those values from within the users node?
Note: This is all within an Adapter, which I think is irrelevant but by way of doubt.