A checkbox is a specific type of two-states button that can be either
checked or unchecked. A example usage of a checkbox inside your activity
would be the following:
public class MyActivity extends Activity {
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.content_layout_id);
final CheckBox checkBox = (CheckBox) findViewById(R.id.checkbox_id);
if (checkBox.isChecked()) {
checkBox.setChecked(false);
}
}
}
See the Checkboxes
guide.
XML attributes
See {@link android.R.styleable#CompoundButton CompoundButton Attributes},
{@link android.R.styleable#Button Button Attributes},
{@link android.R.styleable#TextView TextView Attributes},
{@link android.R.styleable#View View Attributes}
|