I've been wasting too much time on this one so have to ask again. I've no idea why this is happening at all.
I have an array adapter (aAdapter) and an array list (aList) and I'm trying to put a clear button to erase the entries in a database and to clear the list.
My problem is that NotifyDataSetChanged() just wont work from inside my onlick method here:
public void clearDB(View view) {
aList.clear();
aAdapter.notifyDataSetChanged();
HighScoresDB hsdb = new HighScoresDB(HighScoresActivity.this);
hsdb.openDB();
hsdb.clearDB();
hsdb.closeDB();
}
It works from everywhere else though. I've even tried putting the clear and notifyDataSetChanged() in another method and calling it but that doesn't work either but did work when I called it from the onCreate....
Any ideas?
p.s. the database is being cleared.
notifyDataSetInvalidated()
instead ofnotifyDataSetChanged()
? – Ecumenicism