½ÇÇà°¡´ÉÇÑ ¾Û ¸ñ·Ï (Get launchable apps in android)
7³â Àü
¾Èµå·ÎÀ̵忡¼ ½ÇÇà°¡´ÉÇÑ ¾Û¸¸ ÃßÃâÇϱâ
public static List<ApplicationInfo> getAllInstalledApplications(Context context) {
List<ApplicationInfo> installedApps = context.getPackageManager().getInstalledApplications(PackageManager.PERMISSION_GRANTED);
List<ApplicationInfo> launchableInstalledApps = new ArrayList<ApplicationInfo>();
for(int i =0; i < installedApps.size(); i++){
if(context.getPackageManager().getLaunchIntentForPackage(installedApps.get(i).packageName) != null){
//If you're here, then this is a launch-able app
launchableInstalledApps.add(installedApps.get(i));
}
}
return launchableInstalledApps;
}