RadioButton View and CheckBox View in Android
When you are creating a form to accept users inputs in your android app then you have to list down a few options for the user to choose from, checkboxes and radio boxes can be used.
So the functional difference between radio box and check box is that we can use radio box when out of multiple options you need to select only one if multiple selection is allowed then check box can be used.
CheckBox View in Android
Checkbox is used when we have to show multiple options to the user and the user can choose as many options as they want, by tapping on them and we can set its default check status as true or false and other properties are the same as TextView.
This attribute checks that is, places the tick mark in the checkbox are by default.
This covers how we can display a CheckBox view on the app screen and how it works is something that we will learn very soon.
RadioButton View in Android
RadioButton can be used when you have to allow selection of one option among the list of multiple options and It is used under its parent view – RadioGroup so that we can select value out of all the listed radio buttons.
Also RadioGroup is a subclass of LinearLayout and arranges the radio button vertically because it has vertical orientation by default and we can change that by adding the attribute android:orientation=”horizontal” to your RadioGroup in the layout XML file.