Contacts loading problem

buras3

Active Member
Licensed User
Longtime User
hello

i have a problem when i am trying to load contacts
when ever i it's contact "phone only - not synced"
then the line code:
listOfContacts = Contacts1.FindByName("John", False)
can't find the contact

how can i resolve this ?

tank you


Dim Contacts1 As Contacts
Dim listOfContacts As List
listOfContacts = Contacts1.FindByName("John", False)
For i = 0 To listOfContacts.Size - 1
Dim Contact As Contact
Contact = listOfContacts.Get(i)
Log(Contact) 'will print the fields to the LogCat
Dim photo As Bitmap
photo = Contact.GetPhoto
If photo <> Null Then Activity.SetBackgroundImage(photo)
Dim emails As Map
emails = Contact.GetEmails
If emails.Size > 0 Then Log("Email addresses: " & emails)
Dim phones As Map
phones = Contact.GetPhones
If phones.Size > 0 Then Log("Phone numbers: " & phones)
Next
 

kickaha

Well-Known Member
Licensed User
Longtime User
This is not a B4A issue, it is the way your phone is dealing with contacts.

Have a look here for info on that problem, do not know what the answer is though :sign0013:.
 
Upvote 0

buras3

Active Member
Licensed User
Longtime User
tank you

tank you for replaying
but i need to load all the contacts ...

how can i do this
is there another way ?
 
Upvote 0

buras3

Active Member
Licensed User
Longtime User
no error

when the cursor in the for
it's move out of loop

the ContactName is from CallLog
but it's is valid - i checked
it's happen only with unsynced contacts


listOfContacts = Contacts1.FindByName(ContactName ,True)
For i = 0 To listOfContacts.Size - 1

tank you for your help

by the way small question
where can i find list of operator in string like /n in C . or &
for example : number="one " & "two"
i need to make multiline in tabhost title ?
 
Upvote 0

buras3

Active Member
Licensed User
Longtime User
the problem is - in unsync contact this line code return empty

listOfContacts = Contacts1.FindByName(ContactName ,True)
 
Upvote 0
Top