Created
July 24, 2016 17:43
-
-
Save cinohub/afb9a1f08e617106e57d7710c32e64b1 to your computer and use it in GitHub Desktop.
sort by alpha
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
private class ResolveInfoComparator implements Comparator<ResolveInfo> { | |
final PackageManager packageManager; | |
public ResolveInfoComparator(final PackageManager packageManager) { | |
this.packageManager = packageManager; | |
} | |
@Override | |
public int compare(final ResolveInfo resolveInfo, final ResolveInfo resolveInfo2) { | |
final String appLabel = resolveInfo.loadLabel(packageManager).toString(); | |
final String appLabel2 = resolveInfo2.loadLabel(packageManager).toString(); | |
return appLabel.compareTo(appLabel2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment