Sub Button1_Click
    'Dim Contacts As Contacts
    'Dim list1 As List
    list1 = Contacts.GetAll
    Dim listOfNames As List
    listOfNames.Initialize
    'Create a list with the contacts names
   
    For i = 0 To list1.Size - 1
        Dim c As Contact
        c = list1.Get(i) 'fetch the Contact from the original list
        If c.DisplayName.IndexOf("@") = -1 Then 'remove email, keep only contacts
            listOfNames.Add(c.DisplayName)
        End If
    Next
       
    listOfNames.Sort (True)
       
    Dim res As Int
    res = InputList(listOfNames, "Choose contact", -1)
    If res <> DialogResponse.CANCEL Then
        Dim name As String
        name = listOfNames.Get(res)
       
        'Dim c As Contact
        'find the original contact based on the chosen name
        For i = 0 To list1.Size
            c = list1.Get(i)
            If c.DisplayName = name Then Exit
        Next
        'Msgbox(c.GetPhones, "id")
                       
            Dim m As Map
            m = c.GetPhones
        'Dim cisla As List
        cisla.Initialize
            For index = 0 To m.Size-1
                cisla.Add(m.GetKeyAt(index))
            Next
       
        Dim res2 As Int
        res2 = InputList(cisla, "cisla", -1)
        EditText1.Text = cisla.Get(res2)
   
    End If
End Sub