如何获取文件缩略图android

时间:2012-05-26 16:14:30

标签: android

我想在Android中获取像APK文件或图像文件的文件缩略图,我如何找到每个缩略图,我的意思是APK图标的图像或相机图像的缩略图......

非常感谢

1 个答案:

答案 0 :(得分: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;   
}