I'm using "Comparator" to sort my listview. Sort only 1 element, is working, but with 2 the same does not work.
//ordenar por data
arrayAdapter.sort(new Comparator<Vagas>() {
@Override
public int compare(Vagas o1, Vagas o2) {
return o2.getDataAtualizacao().compareTo(o1.getDataAtualizacao());
}
});
And right below it I'm trying to sort by name
//ordenar por nome
arrayAdapter.sort(new Comparator<Vagas>() {
@Override
public int compare(Vagas o1, Vagas o2) {
return o1.getNome().compareTo(o2.getNome());
}
});
Theoretically it was not for him to sort by date and then to sort by name?
If I just leave sorting by name or by date, it sorts normally.