首页 > 代码库 > 29 adapt

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;
}