Last active
August 29, 2015 14:03
-
-
Save captainstu72/3a880c796939b711f27d to your computer and use it in GitHub Desktop.
Android Package Manager Sort by Label
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
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA); | |
Comparator<ApplicationInfo> packageComparator = new Comparator<ApplicationInfo>() { | |
public int compare(ApplicationInfo obj1,ApplicationInfo obj2) { | |
return obj1.loadLabel(pm).toString().compareToIgnoreCase(obj2.loadLabel(pm).toString()); | |
} | |
}; | |
Collections.sort(packages, packageComparator); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment