pick a phone number to a editex

fifiddu70

Well-Known Member
Licensed User
Longtime User
hello all, how do I pick up the phone number of a contact in address book and display it in a editext?
I created a button and a editext, I wish that when I press the button, I visualize the list of telephone contacts and clicking on one of the contacts list, I would see the phone number on EDITEX
 

fifiddu70

Well-Known Member
Licensed User
Longtime User
B4X:
Sub btnContacts_Click
 Dim PhoneContacts As Contacts
    Dim ContactsList, ListOfNames As List
    ContactsList = PhoneContacts.GetAll
    ListOfNames.Initialize
       For i = 0 To ContactsList.Size - 1
        Dim c As Contact
        c = ContactsList.Get(i)
        If c.DisplayName.IndexOf("@") = -1 Then 
            ListOfNames.Add(c.DisplayName)
        End If
   Next
    EmergencyContacts=InputMultiList(ListOfNames,"Contacts")
 
End Sub

pressing that button, you get a list of phone book, but I could not bring up a EDITEX of my program, the selected item but not as a name but as a phone number.
Having said that editext then be called: txtNumber
As I enter the phone number just chosen from the list?
 
Upvote 0
Top