Android Question sort an array and do the same for another array

Devv

Active Member
Licensed User
Longtime User
hi
i have an array (1,3,2,4)
and another array (banana , apple ,orange, strawberry)

the two arrays are always the same length

the first array after sort will be
(1,2,3,4)
i want the second to be
(banana, orange, apple, strawberry)

how could this be done ?
 

Devv

Active Member
Licensed User
Longtime User
Create a custom type:
B4X:
Type MyItem (Number As Int, Frut As String)

Use a single List instead of the two arrays. Sort it with List.SortType.

thanks for fast replay
i cant understand your solution
please give a small example
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…