2012-05-26 50 views

回答

0

請參閱本LINK

private ArrayList<String> getInstalledApps(Context context){ 

    ArrayList<Drawable> results = new ArrayList<Drawable>(); 
    PackageManager pm = context.getPackageManager(); 
    Intent intent = new Intent(Intent.ACTION_MAIN, null); 
    intent.addCategory(Intent.CATEGORY_LAUNCHER); 
    List list = pm.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED); 
    for (ResolveInfo rInfo : list) { 
     results.add(rInfo.activityInfo.applicationInfo.loadIcon(pm); 
    } 
    return results; 
}