Android
android.widget
public class

android.widget.CheckBox

java.lang.Object
android.view.View Drawable.Callback KeyEvent.Callback
android.widget.TextView ViewTreeObserver.OnPreDrawListener
android.widget.Button
android.widget.CompoundButton Checkable
android.widget.CheckBox

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 CompoundButton Attributes, Button Attributes, TextView Attributes, View Attributes

Summary

XML Attributes inherited from class android.widget.TextView
XML Attributes inherited from class android.view.View
Constants inherited from class android.view.View
Fields inherited from class android.view.View

Public Constructors

            CheckBox(Context context)
            CheckBox(Context context, AttributeSet attrs)
            CheckBox(Context context, AttributeSet attrs, int defStyle)
Methods inherited from class android.widget.CompoundButton
Methods inherited from class android.widget.TextView
Methods inherited from class android.view.View
Methods inherited from class java.lang.Object
Methods inherited from interface android.graphics.drawable.Drawable.Callback
Methods inherited from interface android.view.KeyEvent.Callback
Methods inherited from interface android.view.ViewTreeObserver.OnPreDrawListener
Methods inherited from interface android.widget.Checkable

Details

Public Constructors

public CheckBox(Context context)

public CheckBox(Context context, AttributeSet attrs)

public CheckBox(Context context, AttributeSet attrs, int defStyle)

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56