Android SDK provides two types of radio controls to be used in conjunction, where only one control can be chosen at a given time. RadioGroup (android.widget.RadioGroup
) is used to encapsulate a set of RadioButton controls for this purpose.
Before we add the RadioGroup and RadioButton control, let's add the label Distance
and the TextField to allow users to provide inputs. Open the activity_main.xml
file, and add following entries:
<TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="14dp" android:layout_marginTop="44dp" android:text="@string/distance " android:textAppearance="?android:attr/textAppearanceMedium" /...