开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜