Toaster Toaster - 3 months ago 8
Android Question

ListView setItems not updating list

I've got this in my ListView adapter,

public void setListItems(List<String[]> data) {
Log.d(tag, this.data.size() + "," + data.size());
this.data.clear();
this.data = data;
Log.d(tag, this.data.size() + "," + data.size());
notifyDataSetChanged();
}


My log says this:

10,5
0,5


this.data = data; is not working?

TML TML
Answer

replace your

this.data = data

with

this.data.addAll(data)

Comments