I am using the following code to sort an ArrayAdapter alphabetically:
adapter.sort(new Comparator<String>() {
public int compare(String object1, String object2) {
return object2.compareTo(object1);
};
});
Trouble is, it arranges all the Uppercase entries before the lowercase entries.
How do I force it to ignore case?
You can use the String.compareToIgnoreCase()
Or String.toLowerCase() method: