android how can i sort and unsort on list of items in same button click event
I want to sort list of objects in button click event, in next click of same 开发者_如何学Cbutton i want to unsort the list of objects.
You should probably use Collections.
There you can sort by comparators and you can also shuffle the list. IE "Unsort it"... Unsort it is quite odd, either you want to shuffle it or you want to sort it by some other comparator.
Example for collections with a custom class
Shuffle list example
精彩评论