Code example for CheckedTextView

Methods: isChecked, toggle

0
		listView.setOnItemClickListener(new OnItemClickListener() {
 
			@Override 
			public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
				CheckedTextView tv = ((CheckedTextView) view);
				tv.toggle();
				if (tv.isChecked()) {
					mSelectedPositions.add(position);
				} else { 
					mSelectedPositions.remove((Integer) position);
				} 
			} 
		}); 
	} 
 
	private class MyOnDismissCallback implements OnDismissCallback { 
 
		@Override 
		public void onDismiss(ListView listView, int[] reverseSortedPositions) {
			for (int position : reverseSortedPositions) {
				mAdapter.remove(position);