public View getView(int position, View convertView, ViewGroup parent) { // A ViewHolder keeps references to children views to avoid unnecessary calls // to findViewById() on each row. AppViewHolder holder = AppViewHolder.createOrRecycle(mManageApplications.mInflater, convertView); convertView = holder.rootView; // Bind the data efficiently with the holder ApplicationsState.AppEntry entry = mEntries.get(position); synchronized (entry) { holder.entry = entry; if (entry.label != null) { holder.appName.setText(entry.label); } mState.ensureIcon(entry); if (entry.icon != null) { holder.appIcon.setImageDrawable(entry.icon); } updateSummary(holder); if ((entry.info.flags & ApplicationInfo.FLAG_INSTALLED) == 0) { holder.disabled.setVisibility(View.VISIBLE); holder.disabled.setText(R.string.not_installed); } else if (!entry.info.enabled) { holder.disabled.setVisibility(View.VISIBLE); holder.disabled.setText(R.string.disabled); } else { holder.disabled.setVisibility(View.GONE); } } mActive.remove(convertView); mActive.add(convertView); convertView.setEnabled(isEnabled(position)); return convertView; }