Tablelayout - sort rows on column header click

ぃ、小莉子 提交于 2019-12-13 04:46:20

问题


I've created a TableLayout and added rows to it dynamically. I want to sort table content on column header click. Just as in HTML, we can easily sort data using datatables. Can I implement the same functionality in Android TableLayout using some jar files or existing Android functions?

Thanks in advance.


回答1:


See, you can use Collection.sort() for it.

There are so many tutorials on it. see arraylist-example-using-collections-sort. this is logic for sorting. you can make a method that you can execute on your table header click.



来源:https://stackoverflow.com/questions/20063667/tablelayout-sort-rows-on-column-header-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!