Hi to all,
I need to insert some array of object in a list.
Problem is that all elements of the list are the same. I saw in debugging mode that when object 'o' changes, all the elements in list change. How i can solve the problem?
I need to insert some array of object in a list.
B4X:
Sub Process_Globals
Private fx As JFX
Private list As List
Private o(3) As Object
Private a As Int = 0
End Sub
Sub AppStart (Form1 As Form, Args() As String)
list.Initialize
start
End Sub
Sub start
For i = 0 To 99
For j = 0 To o.Length-1
o(j) = a
a = a + 1
Next
list.Add(o)
Next
End Sub
End Sub