I have a checkbox in my ListView row which looks like this.
===========================================
[CheckBox] [TextView] [TextView] [TextView]
===========================================
the xml code is here
<CheckBox
android:id="@+id/course_search_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:clickable="false"
android:focusable="false" />
And I have already made the checkbox not clickable and focusable so that the click event will be passed to the ListView.
What I want to do here is that when the user click the listview, make the CheckBox checked and add the clicked position of listview to an arraylist. So how can I make the CheckBox checked in an OnItemClickListener of ListView?
Help please, thanks.
You could add this code within your
OnItemClickListener: