1
I have the following class I want to sort her values by date
public class ItemListAnuncios {
private String texto;
private String data;
public ItemListPropaganda(String texto, String data) {
this.texto = texto;
this.data= data;
}
public int getTexto() {
return texto;
}
public void setTexto(String texto) {
this.texto= texto;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data= data;
}
I have in my main class:
private ArrayList<ItemListAnuncios > itens;
How can I sort? I’d better send it in date or String format?
Felipe, take a look at this answer. I believe I can help you: Sort Arraylist
– Fernando A.W.
@Felipe, as your date is like string is good you put the format of it too.
– Luídne
See the answer to this question: Sorting an Array
– ramaral