Android Question Empty list unexpectedly

FrankBerra

Active Member
Licensed User
Longtime User
Hi coders

I have 2 lists "List1" and "List2" and i am trying to copy the content of the second to one and then i clear the second one. The code is:
B4X:
List1 = List2
List2.initialize
The problem is that after the initialization the List1 is emptied too!
Why?!

A temporary workaround is:
B4X:
For z = 0 To List2.Size-1
        List1.Add(List2.Get(z))
Next
 
Top