1
Hello, I’m with a barrier how to bring the data from firebase and display in order by date, display from the latest to the oldest, currently the data are being displayed in standard form in firebase.
database = ConfiguracaoFirebase.getDatabase().child("comentarios");
//Listener para recuperar os comentarios
valueEventListenerComentarios = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
//Limpar lista
listaComentarios.clear();
//Listar comentários
for (DataSnapshot dados: dataSnapshot.getChildren() ){
Comentario comentario = dados.getValue( Comentario.class );
listaComentarios.add( comentario );
}
arrayAdapter.notifyDataSetChanged();
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
};
Child dps, you put
.orderBy
, Something like that, just typeorder
the rest should already appear, then you put by which field you want to be done to Sort– Woton Sampaio
Yes, but I have already made a Query, even so, it does not leave decreasing order.
– Robson Cabral