29 adapt

public View getView(int position, View convertView, ViewGroup parent) {
View view = inflater.inflate(R.layout.gv_item, null);
TextView tv = (TextView) view.findViewById(R.id.gv_item_appname);
ImageView iv = (ImageView) view.findViewById(R.id.gv_item_icon);

//tv.setText(packageInfos.get(position).packageName);
tv.setText(pkInfos.get(position).applicationInfo.loadLabel(getPackageManager()));

iv.setImageDrawable(pkInfos.get(position).applicationInfo.loadIcon(getPackageManager()));

return view;
}

posted @ 2014-05-09 11:11  阿黄的苹果  阅读(133)  评论(0编辑  收藏  举报