I write the follow code
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Type cuContacts (DisplayName As String,Id As Long)
Type ep (DisplayName As String,Id As Long)
Dim Epafh As ep
Private Button1 As Button
Private List1 As ListView
Dim cU As Contacts2
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("epafes")
'Epafh.Initialize
Dim cuContacts As List
cuContacts.Initialize
For Each c As Contact In cU.GetAll(True,False)
Epafh.DisplayName=c.DisplayName
Epafh.Id=c.Id
cuContacts.add(Epafh)
Next
cuContacts.SortType("DisplayName",True)
the problem is that when I trace the progrmam I can read the valuse of the epafes.id and epafh.displayname
When the for loop ends I stop the program and check what the cucontacts has inside the array All the lines (69) have the same displayname=admin@pandaray and id=6 (this is the last at the pnone book)
what is it wrong at my code?
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Type cuContacts (DisplayName As String,Id As Long)
Type ep (DisplayName As String,Id As Long)
Dim Epafh As ep
Private Button1 As Button
Private List1 As ListView
Dim cU As Contacts2
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("epafes")
'Epafh.Initialize
Dim cuContacts As List
cuContacts.Initialize
For Each c As Contact In cU.GetAll(True,False)
Epafh.DisplayName=c.DisplayName
Epafh.Id=c.Id
cuContacts.add(Epafh)
Next
cuContacts.SortType("DisplayName",True)
the problem is that when I trace the progrmam I can read the valuse of the epafes.id and epafh.displayname
When the for loop ends I stop the program and check what the cucontacts has inside the array All the lines (69) have the same displayname=admin@pandaray and id=6 (this is the last at the pnone book)
what is it wrong at my code?