Hello, I have a firewall how to bring the data from the firebase and display in order by date, display from the most recent to the oldest, currently the data is being displayed in the default 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) {
}
};