Hi to all,
I need to keep the alignment between a listview and a map using the index as key.
The problem is that each time I have to do an item update I must remove the item and re-add the item to the list because there isn't an update method in the ListView object.
For Example:
The problem is that the indexes change each time I make an item "update" within the listview and I need to keep the indexes (keys) aligned between the listview and the Map.
So my problem is to apply the same ListView index rule to the Map (keys).
So suppose to remove item1 from the listview (suppose a size of 6 items) and add a new item assuming that the new item have the same content with a small addition:
Old item removed: "item1" (index is 3)
New item added: "item1 +" (index is 5) ---> it always assume lsv.size-1 index value
What happen to the others items indexes ? The items before the removed item keep their indexes and the item between the removed item and the last added item will be decreased by 1? Is this right?
I need to keep the alignment between a listview and a map using the index as key.
The problem is that each time I have to do an item update I must remove the item and re-add the item to the list because there isn't an update method in the ListView object.
For Example:
B4X:
lsv.RemoveAt(Index)
lsv.AddTwoLinesAndBitmap(Data, "", Bitmap)
The problem is that the indexes change each time I make an item "update" within the listview and I need to keep the indexes (keys) aligned between the listview and the Map.
So my problem is to apply the same ListView index rule to the Map (keys).
So suppose to remove item1 from the listview (suppose a size of 6 items) and add a new item assuming that the new item have the same content with a small addition:
Old item removed: "item1" (index is 3)
New item added: "item1 +" (index is 5) ---> it always assume lsv.size-1 index value
What happen to the others items indexes ? The items before the removed item keep their indexes and the item between the removed item and the last added item will be decreased by 1? Is this right?
Last edited: