#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim cu As ContactsUtils
End Sub
Sub Globals
Dim lstContacts As ListView
Dim ImageView1 As ImageView
Dim EditText1 As EditText
Private Button1 As Button
Private valor As Int
Dim p As Contacts2
p
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
cu.Initialize
End If
Activity.LoadLayout("1")
For Each c As cuContact In cu.FindContactsByPhone("", False, False)
For Each phone As cuPhone In cu.GetPhones(c.Id)
lstContacts.AddTwoLines2(c.DisplayName, phone.Number, c)
Next
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub lstContacts_ItemClick (Position As Int, Value As Object)
Dim c As cuContact = Value
Dim sb As StringBuilder
sb.Initialize
For Each phone As cuPhone In cu.GetPhones(c.Id)
sb.Append(phone.Number)
Next
Log(c.Id)
valor = c.Id
EditText1.Text = sb.ToString
End Sub
Sub lstContacts_ItemLongClick (Position As Int, Value As Object)
End Sub
Sub Button1_Click
cu.AddPhone(valor, EditText1.Text, "mobile")
End Sub