@Override public View getView(int position, View convertView, ViewGroup parent) { // 获取数据 AppInfo info = (AppInfo) getItem(position); // 获取View ViewCache cache = null; if (convertView == null) { convertView = mInflater.inflate(mItemResource, null); ImageView app_icon = (ImageView) convertView.findViewById(R.id.app_icon); TextView app_name = (TextView) convertView.findViewById(R.id.app_name); CheckBox app_CheckBox = (CheckBox) convertView.findViewById(R.id.app_checkbox); cache = new ViewCache(); cache.app_icon = app_icon; cache.app_name = app_name; cache.app_CheckBox = app_CheckBox; convertView.setTag(cache); } else { cache = (ViewCache) convertView.getTag(); } // 绑定数据 cache.app_icon.setImageDrawable(info.appIcon); cache.app_name.setText(info.appName); Boolean slected = isSelected.get(info.packageName); if (slected == null) { slected = Boolean.FALSE; } cache.app_CheckBox.setChecked(slected); cache.info = info; return convertView; }