Android Question add new object to array?

ilan

Expert
Licensed User
Longtime User
hi

when i create an array of objects i have to set the length of the array at the beginning but what if i would like to add a new object to this array? is it possible?

in java it is:

B4X:
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits[4] = "Lemon";
 

ilan

Expert
Licensed User
Longtime User
B4A List wraps the Java ArrayList. They are the same thing.

:confused::confused::confused: ooppsss. :oops:

Sorry, but i need a list and not an array. I watched box2d tutorials and there they use an arraylist so i thought i will need to use an array in b4a. Sorry for creating this thread.

With a list it will be much simpler.

Thank you everybody :)
 
Upvote 0
Top