Android Question [SOLVED] Lists and sorting them!

aidymp

Well-Known Member
Licensed User
Longtime User
I have a list, and I would like to be able to move items at will, for example -:

move list item 7 to the top of the list.
move item 3 down 1 position.

Looking at it, it appears I have to do this manually??

The question is, whats the procedure?

make another list? and put the items in it one by one in the new order? Seems a very long way to do it!

I have searched the forum, and read the manual, but unfortunately everything is linked to a listview of some type. I have a custom view that works from just a list!!

Any suggestions?

Thanks
 

drgottjr

Expert
Licensed User
Longtime User
if you are talking about sorting a list in some pre-determined order, there is such a method in the list object. it uses a sort field. if you're talking about swapping 4 items in a list of 100 items, then a swap sub could handle it. unclear how you make the choices "at will" and how many choices there will be and how big the list is.
if you're talking about some kind puzzle where the user can drag pieces around, displacing the other pieces in the act, then things become interesting.
 
Upvote 0

aidymp

Well-Known Member
Licensed User
Longtime User
This solved my problem!

 
Upvote 0
Top