Hello,
Something weird.. I used the code below to get all phone contacts in a list.. instead I get the contacts of my Skype (not the phone).
Any help appreciated.
Something weird.. I used the code below to get all phone contacts in a list.. instead I get the contacts of my Skype (not the phone).
Any help appreciated.
B4X:
Sub lstContacts_ItemClick (Position As Int, Value As Object)
Dim c As cuContact = Value
Dim bmp As Bitmap = cu.GetPhoto(c.Id)
If bmp.IsInitialized Then ImageView1.SetBackgroundImage(bmp) Else ImageView1.SetBackgroundImage(Null)
Dim sb As StringBuilder
sb.Initialize
'sb.Append(c.DisplayName).Append(CRLF).Append("Note: ").Append(cu.GetNote(c.Id)).Append(CRLF)
'sb.Append("Starred: ").Append(cu.GetStarred(c.Id)).Append(CRLF)
For Each phone As cuPhone In cu.GetPhones(c.Id)
sb.Append(phone.Number & ", " & phone.PhoneType).Append(CRLF)
Next
For Each email As cuEmail In cu.GetEmails(c.Id)
sb.Append(email.email).Append(", ").Append(email.EmailType).Append(CRLF)
Next
EditText1.Text = sb.ToString
End Sub
Sub lstContacts_ItemLongClick (Position As Int, Value As Object)
'toggle the starred state
Dim c As cuContact = Value
cu.SetStarred(c.Id, Not(cu.GetStarred(c.Id)))
'update the text
lstContacts_ItemClick(Position, Value)
End Su