Dim Count As Int
Dim Flag As Boolean = 0
For Count = 0 To ListView_Connections.Size
If Starter.ConnectedName = ListView_Connections.GetItem(Count) Then
Flag = 1
End If
Next
If Flag = 1 Then
ListView_Connections.AddSingleLine(Starter.ConnectedName)
End If
Is that right? As in, is that the most efficient way to do it?
Supposing you used a list to fill the listVIew, name it lstItems for example, you could do this:
B4X:
if lstItems.indexof(Starter.ConnectedName)=-1 then
lstItems.add(Starter.ConnectedName)
ListView_Connections.AddSingleLine(Starter.ConnectedName)
end if