0

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

多谢

4

1 回答 1

0

参考这个链接

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;   
}
于 2012-05-26T16:25:27.907 回答