Code example for CheckBox

Methods: setChecked, setOnClickListener

0
			checkBox.setId(position);
		} 
		public void setData(CompositeDataHolder compositeDataHolder) {
			final GridDataHolder dataHolder = (GridDataHolder)compositeDataHolder;
			imageView.setImageBitmap(dataHolder.bitmap);
			checkBox.setChecked(dataHolder.selected);
			checkBox.setOnClickListener(new OnClickListener() {
				public void onClick(View v) {
					dataHolder.selected = !dataHolder.selected;
				} 
			}); 
		} 
	} 
	class ListDataHolder implements CompositeDataHolder { 
		Bitmap bitmap;
		Uri uri;
		 
		ListDataHolder(Bitmap b, Uri u) { bitmap = b; uri = u; }
		public CompositeViewHolder createCompositeViewHolder() { return new ListViewHolder(); } 
	} 
	class ListViewHolder implements CompositeViewHolder {