Android Question How to change the content in ListView?

tongpudian

Member
_20171206095241
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
You have several ways to do that :
- if you maintain a separate list where the content is set, you can use Clear to clear the ListView and modify the content in the separated list then fill the ListView with the list's content
- or you can RemoveAt(Index) to remove the line you want to be modified and add a new line to the ListView with the new content
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
I use an internal list, make the changes. Re-sort then clear the listview and then repopulate it from the list
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
I'll test it for listview in a test app
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
To

Tomorrow when I'm back home

here it is. Like Erel said it's better to use Customlistview.

In my example it's very simple. If you want to know where each item is after re-sorting use the tag for each item. Or perhaps use a map
 

Attachments

  • lvtest.zip
    7.4 KB · Views: 149
Last edited:
Upvote 0
Top