Android Question Delete item in customlist view by customlistview Value?

mangojack

Well-Known Member
Licensed User
Longtime User
This will work fine where all CLV Item values are unique ..
B4X:
RemoveItemByValue(myValue)
    
Sub RemoveItemByValue(Val As Object)
  For i = 0 To clv1.Size -1
    If Val  = clv1.GetValue(i) Then
      clv1.RemoveAt(i)
      Return
    End If
  Next
End Sub



If you wish to remove multiple items (with same value) you would want to loop from the end of list ...
and remove the Return call ...

B4X:
For i = clv1.Size -1 To 0 Step -1
 
Upvote 0
Top