Android Question help with for loop

apty

Active Member
Licensed User
Longtime User
I have a for loop where i am looping through a list. There is also another list but i only need a few items from this list. For example, my list has the following information:
The list i am using to loop (list 1):
B4X:
Depart flight, Price A, Location A
Depart flight, Price B,Location A

The second list
B4X:
Return flight, Price C, Location C

Now i want to return the data as below after looping through the list:
Depart flight,Price A,From:Location A,To:Location C
Depart flight,Price B,From:Location A,To:Location C
Return flight,Price C,From:Location C,To:Location A

If i try looping using 1st list i get index out of bounds error when trying to pick Location C on depart flight
 

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Without seeing the code you're using to populate the list, it is impossible to answer your question. Since I have to guess, my best guess would be make sure your loop is going from zero to list.Size - 1.
 
Upvote 0
Top