Last active
February 18, 2016 13:05
-
-
Save basarik/475867366488ef5abe10 to your computer and use it in GitHub Desktop.
Android Collection sort by Turkish chracters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collections.sort(stringList, new Comparator<String>() { | |
@Override | |
public int compare(String lhs, String rhs) { | |
final Collator collator = Collator.getInstance(new Locale("tr_TR")); | |
return collator.compare(lhs.toUpperCase(), rhs.toUpperCase()); // toUpperCase to avoid a dotless i problem (was at the end) | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment