0
I am making a list, and on this list I pull up the following information id, idPostagem, description, usergroup and photoUsuario.
However to popular(add) data to this list I am using the following code snippet within an Activity:
itensSalvosRef = ConfiguracaoFirebase.getFirebase().child("itens-salvos").child(idUsuarioLogado);
@Override
protected void onStart() {
super.onStart();
listarItensSalvos();
}
private void listarItensSalvos() {
valueEventListener = itensSalvosRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
listaItemSalvo.clear();
for (DataSnapshot ds : dataSnapshot.getChildren()) {
listaItemSalvo.add(ds.getValue(ItemSalvo.class));
}
Collections.reverse(listaItemSalvo);
itensSalvosAdapter.notifyDataSetChanged();
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
Firebase structure:
The idea is to recover all values, but it only recovers the name Suario, as shown in the photo below:
What I’m doing wrong to the popular (add values) to that list?
The names of your class properties
listaItemSalvo
are totally different from your firebase bank, only the fieldnomeUsuario
is correct, so only it is coming filled...– Matheus Ribeiro
@Matheusribeiro Nossa... kkk was just that, I was so focused on something else that I didn’t think about the obvious, thank you. If you want to reply so I can mark it as a response, you can reply!
– Luis Felipe