Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
cu.Initialize
End If
Activity.LoadLayout("1")
runtime.CheckAndRequest(runtime.PERMISSION_WRITE_CONTACTS)
End Sub
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
DeleteContacts("xxx@gmail.com")
DeleteContacts("xxx@gmail.com") 'should show 0 matches
End If
End Sub
Sub DeleteContacts(mail As String)
Dim contacts As List = cu.FindContactsByMail(mail, True, False)
Log("Matches: " & contacts.Size)
For Each c As cuContact In contacts
Log(c.DisplayName)
Log(c.Id)
cu.DeleteContact(c.Id)
Next
End Sub