Hello,
i'm trying to save all the activity's imageviews (generated by the designer) in an array (with their original position), but when i do it, all positions of the array point to the same object (a reference to the last view i get).
What am i wrong?
my code is:
Thanks in advance
i'm trying to save all the activity's imageviews (generated by the designer) in an array (with their original position), but when i do it, all positions of the array point to the same object (a reference to the last view i get).
What am i wrong?
my code is:
B4X:
Sub Process_Globals
[...]
Type Immagine(img As ImageView, OrigX As Int, OrigY As Int)
[...]
End Sub
Sub Globals
[...]
Private Immagini(9) As Immagine
[...]
End Sub
Sub Activity_Create(FirstTime As Boolean)
[...]
Dim i As Int
Dim iv As Immagine
i=0
For Each v As ImageView In Activity.GetAllViewsRecursive
If v Is ImageView Then
iv.img=v
iv.OrigX=v.Left
iv.OrigY=v.top
Immagini(i)=iv
i=i+1
End If
Next
[...]
Thanks in advance