FileDocCategorySizeDatePackage
CheckBox.javaAPI DocAndroid 1.5 API2034Wed May 06 22:41:56 BST 2009android.widget

CheckBox

public class CheckBox extends CompoundButton

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);
}
}
}

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}

Fields Summary
Constructors Summary
public CheckBox(android.content.Context context)

        this(context, null);
    
public CheckBox(android.content.Context context, android.util.AttributeSet attrs)

        this(context, attrs, com.android.internal.R.attr.checkboxStyle);
    
public CheckBox(android.content.Context context, android.util.AttributeSet attrs, int defStyle)

        super(context, attrs, defStyle);
    
Methods Summary