Android ListView with CheckBox
This example show how to implement ListView with CheckBox, modified from the post " Custom ListView with ImageView ". At the beginning, I tried to implement OnCheckedChangeListener for the CheckBox; to handle the check state. But, it will be called when the ListView item scroll-out from the screen, and clear the check state unexpectedly. Finally, I implement OnClickListener. It work as expected. /res/layout/row.xml android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> android:id="@+id/rowCheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"/> android:id="@+id/rowImageView" android:layout_gravity="center" android:layout_width="48dp" android:layout_height="48dp" /> android:id="@+id/rowTextView"