CheckBox was added in API Level 1
A checkbox is a specific type of two-states button that can be either checked or unchecked.
1. Add the below import to the imports section.
import android.widget.CheckBox;
2. Add the below line to the onCreate method. This will create a new CheckBox object named myCheckBox.
CheckBox myCheckBox;
3. Compile and run!
Resources:
http://developer.android.com/reference/android/widget/CheckBox.html
Popular Posts
- Select All Text in an EditText on Focus
- android:ellipsize - Add an ellipsis(...) in a TextView
- Cursor getColumnIndexOrThrow - Get the Index for a Column Name
- android:drawablePadding - Add Padding to a Drawable in a TextView, in XML
- Solution: Running Android Lint has encountered a problem Failed
- How to Install an SDK package
- requestFocus - Set Focus to a TextView, using requestFocus, in Java
- setEllipsize - Make a Scrolling Marquee, using scrollHorizontally, in a TextView
- How to Import a Library
- How to Reference a Library in your Project