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.
Question
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.
Solution
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.