then you will get an error and the reason is because in first place you add 11 items and every item you enter a specific value that is the i from the loop
now every items index (place in the list) is the same like the value "i", that will stay like this if you wont delete any item but if you delete now index 7 that is in pos 7
your list would look like this
item1: value=0 (index or position in list is 0)
item2: value=1 (index or position in list is 1)
item3: value=2 (index or position in list is 2)
item4: value=3 (index or position in list is 3)
item5: value=4 (index or position in list is 4)
item6: value=5 (index or position in list is 5)
item7: value=6 (index or position in list is 6) item8: value=8!!!! (index or position in list is 7)
item9: value=9 (index or position in list is 8)
item10: value=10 (index or position in list is 9)
so if you try to remove item with index 10 you will get an error because your list has now only until index 9
so you will need to search for an item that store that value and remove it...
what i believe is that he is mixing the real index position and the value "i" that he has added in the first loop
he need to understand that every time he removes items the index will be different from the value he stored at the first loop
because in first loop he has an item with value 10 that is also in index 10 but after delete an item this item will still have value 10 but will be in index 9!!
Probably, with a few modifications, you can use a Map instead of a List (I'm talking about the internal List of the class) and then give the opportunity to manage the Item by "name" (name can be any object).
If I'm not mistaken, that parameter, Value (which is an Int) is a value associated to an item.
So (when I am awake) we could change its type to Object and create a function to get the item by that object.
If I'm not mistaken, that parameter, Value (which is an Int) is a value associated to an item.
So (when I am awake) we could change its type to Object and create a function to get the item by that object.
Thank you my friends.
no no no you wasn't understand.
assume i have 10 item in customlistview
now i remove item index 4 from list and it removed and again remove index item 4 and it return error
i use index from line 4 for position item because i load different layout that contain button and when i click on button should be remove item
I save index of each panel in button tag
when i click on button i get button tag (it is index) and then remove item with index
but after remove item,count of item in list minus 1 and not exist index
how i load all views?your meaning is load all item again?