1.CheckBox
CheckBoxes allow the user to select one or more options from a set. Typically, you should present each CheckBox option in a vertical list.A CheckBox is a specific type of two-states button that can be either checked or unchecked.
2.How to use CheckBox?
- To use CheckBox ,create or drag and drop the Checkbox view into the Application layout.
- Checkbox allows user to select multiple item.
- Define the checkBox resource by creating the object and finding the resource id by following line
final CheckBox checkbox =(CheckBox)findViewById(R.id.checkbox1);
- Register a click listener for each CheckBox view.
- Implements the method.
public void onClick(View view)
{
if(checked)
// check the choice
else
// uncheck the choice
}
3. Methods of CheckBox
- public void onIntializedAccessibilityEvent(AccessibiltyEvent event) called when the source of an accessibility event is the view whose state change triggered firing the event.
- public void onIntializedAccessibilityNodeInfo(AccessibilityNodeInfo info) called to initialize an AccessibilityNodeInfo with information about the view. the base implementation sets :
- setParent(View),
- setBoundsInParent(Rect),
- setBoundsInScreen(Rect),
- setPackageName(CharSequence),
- setClassName(CharSequence),
- setContentDescription(CharSequence),
- setEnabled(boolean),
- setClickable(boolean),
- setFocusable(boolean),
- setFocused(boolean),
- setLongClickable(boolean),
- setSelected(boolean)


0 comments:
Post a Comment