Wednesday, 28 August 2013

basic information about holder in android

basic information about holder in android

I'm searching for some information about "holder" in android...because
I've seen some code that used it in using checkbox in gridview...but I
couldn't find basic information about it. I'll be happy if anyone can help
me. here is a part of a code that used holder :
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = mInflater.inflate(
R.layout.galleryitem, null);
holder.imageview = (ImageView)
convertView.findViewById(R.id.thumbImage);
holder.checkbox = (CheckBox)
convertView.findViewById(R.id.itemCheckBox);
convertView.setTag(holder);
}
else {
holder = (ViewHolder) convertView.getTag();
}
holder.checkbox.setId(position);
holder.imageview.setId(position);

No comments:

Post a Comment