I need to sort an ArrayList by a certain value.
In this case, the list object getUsers23 is a String, but I need to compare that value as double.
Example value or getUser23 = "67.455432434234"
At the moment, using Collections.sort() to sort the arrayList is sorting the arrayList by getUser23 as string value:
Collections.sort(spotsList1, new Comparator<Spots>(){
public int compare(Spots obj1, Spots obj2) {
return obj1.getUsers23().compareToIgnoreCase(obj2.getUsers23());
}
});