

Finally we perform setOnClickListener event on Button so whenever a user click on Button the selected answers of questions is displayed by using a Toast. After that we create an String array for questions and then set an adapter to fill the data in the ListView. In this step Firstly we get the reference of Button and ListView. And if I check the select all checkbox, all the items in the listview will be checked ForUploadActivity.

I also have 1 checkbox in the forupload activity which named select all, that if all the items in the listview are checked, the select all checkbox will be set as checked. Step 4: Open src -> package -> MainActivity. 1 of the holder in listview layout is a checkbox. Step 3: Create a new xml file i.e list_items.xml inside layout and add the below code:In this step we create a new xml file and add the code for displaying a TextView and RadioButton’s. In this step we open xml file and add code for displaying ListView. Step 2: Open res -> layout ->activity_main. Step 1: Create a new project and name it RadioButtonInsideListView. If you are new here then first read our RadioButton tutorial and ListView tutorial. In this example we also display a Submit button and perform setOnClickListener event on Button so whenever a user click on this Button the selected answers of questions is displayed by using a Toast. Firstly we create an String array for questions and then set an adapter to fill the data in the ListView. For providing these options we use Radio Buttons with Radio Group inside our list item. In this example we create a list of Questions with two options yes or no. Here is the example of using RadioButton Inside ListView.
