It's easy to remove
, add
and insert
an item from the listview adapter object, but I don't think I see a direct method to update
an item in the listview adapter. Obviously, I could simply replace via remove/add, but I want to make sure I'm not missing something obvious.
Right now, I'm simply updating the underlying Item Array and refresh the entire listview by recreating/assigning the adapter (probably also not very elegant).
I hope the question is clear enough.
Asked
Active
Viewed 1,443 times
0

Mairyu
- 809
- 7
- 24
1 Answers
0
If you are using ArrayList in adapter class for update In ArrayList there is method called set()
which update the item in arraylist after updation call notifyItemchanged()
which update an item in listview
Check this link

Vishal Yadav
- 3,642
- 3
- 25
- 42
-
yeah, it was more academic curiosity to see if it can be done via the adapter object, but I understand that this is used more for temporary things like filtering the shown results (instead of altering the underlying ArrayList) – Mairyu Jul 01 '17 at 19:21