Actually the code in the first post should work. B4A List wraps java ArrayList.
The problem is somewhere else.
Erel, it seems when B4A create a List (better, when B4A
add an item to list), the roomsize of the list (seen on the debugger) is for 12 item.
Yes, the size returns correctly the number (1), but... could be the library inside check the List by roomsize within a cycle?
AFAYK java takes room for List like B4A does?
As expected, the solution given by Roycefer give us the same problem (Attempt to read from null array).
Now we try to write an inline java function to create List directly from java and will post the result.