O'Reilly logo

Android Development Tools for Eclipse by Sanjay Shah, Khirulnizam Abd Rahman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a CheckBox

We will use CheckBox to allow users to have a conversion facility available for multiple types of conversions, at once. To add a CheckBox, add the following code in activity_main.xml. We will have three checkboxes for each: Mile, Foot, and Yard; the same can be achieved using:

<CheckBox android:id="@+id/checkBoxFoot" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView1" android:layout_below="@+id/checkBoxMile" android:text="@string/toFoot"> </CheckBox> <CheckBox android:id="@+id/checkBoxYard" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/checkBoxFoot" android:layout_below="@+id/checkBoxFoot" android:text="@string/toYard"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required