Every now and then I get this error java.lang.IndexOutOfBoundsException: Invalid index 35, size is 35...and I am unsure of why. I generate 36 random numbers and then assign them to a listview...then pull them out of the listview like:
Most of the time everything goes fine, but sometimes this stops the program and highlights 'TheNumberIs = ListView1.GetItem(35)'
My program calls this process many times and usually does fine. Any idea of what is going wrong here? How can it be out of bounds if the size is 0-35?
B4X:
Number1 = ListView1.GetItem(0)
Number2 = ListView1.GetItem(1)
Number3 = ListView1.GetItem(2)
...
...
Number36 = ListView1.GetItem(35)
Most of the time everything goes fine, but sometimes this stops the program and highlights 'TheNumberIs = ListView1.GetItem(35)'
My program calls this process many times and usually does fine. Any idea of what is going wrong here? How can it be out of bounds if the size is 0-35?