My ListView is linked to the database (with SimpleCursorAdapter).
What should I do once user clicked on the row to change the icon?
I’ve tried to:
- update database value;
- change icon manually;
- call
myCursor.notifyDataSetChanged();
It doesn’t work – nothing is changed.
If I don’t call myCursor.notifyDataSetChanged();, then icon is changed. But once I move ListView, it disappears.
If I associate myCursor with ListView again, then it works, but the whole ListView is re-drawn, list is scrolled to the top, which is incorrect behaviour.
What should I do?
OK, I’ve found the answer – I should
requerythe cursor.