I have a "Runnable" method that executes on a new Thread a certain method to update my list.
Every time I call this "Runnable", I'm creating a new Thread, which for me is not very positive ...
How can I do the same thing using an AsyncTask?
Here's my method:
public void atualizaLista(){
Thread t = new Thread("Thread1") {
@Override
public void run() {
runOnUiThread(new Runnable() {
public void run() {
// Atualiza lista
atualiza();
}
});
}
};
t.start();
}