What is the object parameter in indexOf() when used with the List returned by getPackageManager().getInstalledPackages(0)? I have done a Collections.sort on the list with a comparator comparing packageName. I want to get the indexOf based on a string that is a packageName but I cant figure out how that parameter will be formed. I’ve tried
PackageInfo searchInfo = new PackageInfo();
searchInfo.packageName = procName;
int nameIndex = packs.indexOf(searchInfo);
and it returns -1
You may look at this code.Here you can compare with packageName…..