Android.Widget.CheckBox Class

java Example

 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 Also: CheckBox Members

Syntax

[Android.Runtime.Register("android/widget/CheckBox", DoNotGenerateAcw=true)]
public class CheckBox : CompoundButton

Remarks

java Example

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

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:

See the Checkboxes guide.

XML attributes

See NoType:android/R$styleable;Href=../../../reference/android/R.styleable.html#CompoundButton, NoType:android/R$styleable;Href=../../../reference/android/R.styleable.html#Button, NoType:android/R$styleable;Href=../../../reference/android/R.styleable.html#TextView, NoType:android/R$styleable;Href=../../../reference/android/R.styleable.html#View

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1