取系统中的图片

private List<ResolveInfo> loadApps() {

      List<ResolveInfo> mApps;

Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);

mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);

mApps = getPackageManager().queryIntentActivities(mainIntent, 0);

      return mApps; 

}

使用

List<ResolveInfo> mApp = loadApps() ;

ImageView imageView = new ImageView(context); 

ResolveInfo info = mApps.get(position);

imageView.setImageDrawable(info.activityInfo.loadIcon(getPackageManager()));

posted @ 2011-09-15 16:52  镇水古月  阅读(178)  评论(0编辑  收藏  举报