½ÇÇà°¡´ÉÇÑ ¾Û ¸ñ·Ï (Get launchable apps in android) |
|
|
 |
8³â Àü |
¾Èµå·ÎÀ̵忡¼ ½ÇÇà°¡´ÉÇÑ ¾Û¸¸ ÃßÃâÇϱâ
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;
}
# https://stackoverflow.com/questions/12692870/filter-out-non-launchable-apps-when-getting-all-installed-apps/13178695#13178695
|
|
̵̧ : 333 |
̵̧
¸ñ·Ï
|
|