B4X:
Dim list1 As List
list1 = Contacts2.GetAll(True, False)
Dim listOfContacts As List
listOfContacts.Initialize
For i = 0 To list1.Size - 1
Dim c As Contact
c = list1.Get(i)
If c.DisplayName.IndexOf("@") = -1 Then
Dim m As Map
m = c.GetPhones
If m.Size > 0 Then
For CellHome = 0 To m.size-1
listOfContacts.Add(c.DisplayName)
Next
End If
listOfContacts.Sort(True)
End If
Next
Dim res As Int
res = InputList(listOfContacts, "Choose contact", -1)
If I eliminate this part:
B4X:
Dim m As Map
m = c.GetPhones
If m.Size > 0 Then
For CellHome = 0 To m.size-1
listOfContacts.Add(c.DisplayName)
Next
End If
Is there a way to optimize this? It seems to run the same speed whether I show contact phone numbers, label the contacts (cell, home, work, etc.) or just run it showing only contact names.