So I have a listview where I wanted to sort the NumberOfRecords in descending order. I have a custom array adapter but I called my sorting class before I place a data in my
Try with this Comparator.
Comparator objComparator = new Comparator() { public int compare(Object o1, Object o2) { int no1 = Integer.parseInt((String) o1); int no2 = Integer.parseInt((String) o2); return no1 < no2 ? -1 : no1 == no2 ? 0 : 1; } }; Collections.sort(myIntegerList, objComparator);