

xml file and go the design view of this list and in here, this is a linear layout, so we will change this tag to text view so just change it to textview and same we will do here so we will initialize and add this text view with this keyword textview. Step 3) Now name to your layout, for example, we want to make a list of names, so we can name it as 'name_list' and click finish.This will create a new xml file in our layout folder inside the resources folder. So right click my layout and go to ‘new’ and in here, the last option is the xml file, so go to xml and then click layout xml value. Step 2) Now in order to populate this list, we have to create another layout with our text boxes and then we will populate multiple text boxes in this listview. Step 1) First in blank project drag and drop a container called listview from your palette. Please follow the steps below in order to use listview with an example: Listview is used to display any list in our Android activity. Import 7.app.This tutorial gives a step by step explanation of how to use listview in our android activity. 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.

Step 4: Open src -> package -> MainActivity. 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.
