Quantcast
Channel: After sorting JSONArray,Custom list view not changed? - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Kona Suresh for After sorting JSONArray,Custom list view not changed?

$
0
0

Before set the data to Listview, you should sort the data using comparator class in java.

you create one Model class with all variable what you want (name,booth_id etc)and store the each object into the ArrayList.

Collections.sort(ArrayListObject,new NameComparator()); 

example

class NameComparator implements Comparator{  public int compare(Object o1,Object o2){  YourClassName s1=(YourClassName )o1;  YourClassName s2=(YourClassName )o2;  return s1.name.compareTo(s2.name);  }  } 

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>