I have a list of items lets say for example "a", "b", "c". As an input from the user, i would like to have an order specified for these items, for example {a, c, b} or {b, c, a} etc. Is there a standard way in android to take these kinds of inputs or it would be great if anyone could suggest a way to achieve this.
Asked
Active
Viewed 125 times
1
-
Please go into more detail. Ie: paste code – JackMahoney Apr 08 '12 at 23:38
-
Please, more details / explanations of what you are trying to do... !! – Matthieu Apr 08 '12 at 23:39
-
I do not have any existing code. This is a task that i would like to achieve i.e receiving an order as an input from the user. – user1253887 Apr 08 '12 at 23:40
-
If i provide the user with strings "a", "b", "c" then user provide an order of these strings such as {a, b, c} or {b, c, a} etc as input. Is there a nice way to achieve this – user1253887 Apr 08 '12 at 23:46
1 Answers
1
This is an overly broad question. Questions like how long the list is could be may be important, but:
I'd recommend a drag and drop function for the user reordering of listview items by drag and drop using android as that would be pretty natural and fluid for the user to use for reordering.
Then you can save your listview state: Saving advanced state of an Android Listview If you wanted to save it to a DB or something I don't know because of the overly broad question, but you could do anything like that too.

Community
- 1
- 1

TryTryAgain
- 7,632
- 11
- 46
- 82
-
1Thanks for your recommendation.Reordering items in list view definitely sounds like a good solution to my problem. There are 4 items in the list. – user1253887 Apr 08 '12 at 23:50
-
That should be perfect then, I think Pandora uses something similar, and they have up to 100 possible stations in their list, so 4 would be no problem/hassle for the user. Have fun, Thanks. – TryTryAgain Apr 08 '12 at 23:55