I have a listview with check box
I'mlookingtoputacheckboxonthelist.ThenwhenIselectit,IwanttoselecteverythingfromthelistandwhenIclicktotaketheselectionIwanttotaketheselectionfromthewholelist.
Howtodothis?
ThisistheXMLthatI'vecreatedtobethelayoutofeachlistitem
<CheckBoxandroid:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="CheckBox" />
<TextView
android:id="@+id/code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/checkBox1"
android:layout_alignBottom="@+id/checkBox1"
android:layout_toRightOf="@+id/checkBox1"
android:text="TextView" />
Here I set the adapter, the list passed as parameter has the name and the number of the recipient.
dataAdapter = new MyCustomAdapter(this,R.layout.item_list_info, lista);
ListView listView = (ListView) findViewById(R.id.lista);
listView.setAdapter(dataAdapter);