I already has hashmap of apps usage. in details,a List of apps
//apps<Resolveinfo>
List<ResolveInfo> pkgAppsList = new ArrayList<ResolveInfo>();
PackageManager pm = this.getPackageManager();
pkgAppsList = pm.queryIntentActivities(mainIntent, 0);
and hashmap of popularity with package name as key string and usage as integer(number of user clicks on each app).
//hashmap<String,Integer>
public static HashMap listpopularity = new HashMap<String, Integer>();
listpopularity.put("com.example.app1",23)
listpopularity.put("com.example.app2",11)
what is best approach sort apps list according to package usages in hashmap. there may some apps that are not in hashmap usage because of user not clicked on app