Build 1.0_r1(from source)

android.widget
Class RadioButton

java.lang.Object
  extended by android.view.View
      extended by android.widget.TextView
          extended by android.widget.Button
              extended by android.widget.CompoundButton
                  extended by android.widget.RadioButton
All Implemented Interfaces:
Drawable.Callback, KeyEvent.Callback, ViewTreeObserver.OnPreDrawListener, Checkable

public class RadioButton
extends CompoundButton

A radio button is a two-states button that can be either checked or unchecked. When the radio button is unchecked, the user can press or click it to check it. However, contrary to a CheckBox, a radio button cannot be unchecked by the user once checked.

Radio buttons are normally used together in a RadioGroup. When several radio buttons live inside a radio group, checking one radio button unchecks all the others.

XML attributes

See CompoundButton Attributes, Button Attributes, TextView Attributes, View Attributes


Nested Class Summary
 
Nested classes/interfaces inherited from class android.widget.CompoundButton
CompoundButton.OnCheckedChangeListener, CompoundButton.SavedState
 
Nested classes/interfaces inherited from class android.widget.TextView
TextView.BufferType
 
Nested classes/interfaces inherited from class android.view.View
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener
 
Field Summary
 
Fields inherited from class android.view.View
DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIRST_STATE_SET, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, INVISIBLE, KEEP_SCREEN_ON, LAST_STATE_SET, mBottom, mContext, mCurrentAnimation, MIDDLE_STATE_SET, mLayoutParams, mLeft, mLocation, mMeasuredHeight, mMeasuredWidth, mOnClickListener, mOnCreateContextMenuListener, mOnFocusChangeListener, mOnLongClickListener, mPaddingBottom, mPaddingLeft, mPaddingRight, mPaddingTop, mParent, mRight, mScrollX, mScrollY, mTag, mTop, NO_ID, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FIRST_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_LAST_STATE_SET, PRESSED_MIDDLE_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_SINGLE_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SINGLE_STATE_SET, SOUND_EFFECTS_ENABLED, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET
 
Constructor Summary
RadioButton(Context context)
           
RadioButton(Context context, AttributeSet attrs)
           
RadioButton(Context context, AttributeSet attrs, int defStyle)
           
 
Method Summary
 void toggle()
          Change the checked state of the view to the inverse of its current state
 
Methods inherited from class android.widget.CompoundButton
drawableStateChanged, isChecked, onCreateDrawableState, onDraw, onRestoreInstanceState, onSaveInstanceState, performClick, setButtonDrawable, setButtonDrawable, setChecked, setOnCheckedChangeListener, setOnCheckedChangeWidgetListener
 
Methods inherited from class android.widget.TextView
addTextChangedListener, append, append, computeHorizontalScrollRange, computeScroll, computeVerticalScrollRange, debug, getAutoLinkMask, getBaseline, getCompoundDrawablePadding, getCompoundDrawables, getCompoundPaddingBottom, getCompoundPaddingLeft, getCompoundPaddingRight, getCompoundPaddingTop, getCurrentHintTextColor, getCurrentTextColor, getDefaultEditable, getDefaultMovementMethod, getEllipsize, getError, getExtendedPaddingBottom, getExtendedPaddingTop, getFilters, getFocusedRect, getFreezesText, getGravity, getHint, getHintTextColors, getKeyListener, getLayout, getLineBounds, getLineCount, getLineHeight, getLinksClickable, getLinkTextColors, getMovementMethod, getPaint, getPaintFlags, getSelectionEnd, getSelectionStart, getText, getTextColor, getTextColors, getTextColors, getTextScaleX, getTextSize, getTotalPaddingBottom, getTotalPaddingLeft, getTotalPaddingRight, getTotalPaddingTop, getTransformationMethod, getTypeface, getUrls, hasSelection, length, makeNewLayout, onCreateContextMenu, onDetachedFromWindow, onFocusChanged, onKeyDown, onKeyShortcut, onKeyUp, onMeasure, onPreDraw, onTextChanged, onTouchEvent, onTrackballEvent, onWindowFocusChanged, performLongClick, removeTextChangedListener, setAutoLinkMask, setCompoundDrawablePadding, setCompoundDrawables, setCompoundDrawablesWithIntrinsicBounds, setCursorVisible, setEditableFactory, setEllipsize, setEms, setError, setError, setFilters, setFrame, setFreezesText, setGravity, setHeight, setHighlightColor, setHint, setHint, setHintTextColor, setHintTextColor, setHorizontallyScrolling, setIncludeFontPadding, setKeyListener, setLines, setLineSpacing, setLinksClickable, setLinkTextColor, setLinkTextColor, setMaxEms, setMaxHeight, setMaxLines, setMaxWidth, setMinEms, setMinHeight, setMinLines, setMinWidth, setMovementMethod, setPadding, setPaintFlags, setScroller, setSelectAllOnFocus, setShadowLayer, setSingleLine, setSingleLine, setSpannableFactory, setText, setText, setText, setText, setText, setTextAppearance, setTextColor, setTextColor, setTextKeepState, setTextKeepState, setTextScaleX, setTextSize, setTextSize, setTransformationMethod, setTypeface, setTypeface, setWidth
 
Methods inherited from class android.view.View
addFocusables, addTouchables, applyDrawableToTransparentRegion, bringToFront, buildDrawingCache, cancelLongPress, clearAnimation, clearFocus, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeVerticalScrollExtent, computeVerticalScrollOffset, createContextMenu, debug, debugIndent, destroyDrawingCache, dispatchDraw, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, draw, finalize, findFocus, findViewById, findViewTraversal, findViewWithTag, findViewWithTagTraversal, fitSystemWindows, focusSearch, forceLayout, gatherTransparentRegion, getAnimation, getApplicationWindowToken, getBackground, getBottom, getBottomFadingEdgeStrength, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRightFadingEdgeStrength, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTop, getTopFadingEdgeStrength, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, hasFocus, hasFocusable, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInTouchMode, isLayoutRequested, isLongClickable, isPressed, isRootNamespace, isSaveEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onAttachedToWindow, onFinishInflate, onKeyMultiple, onLayout, onScrollChanged, onSetAlpha, onSizeChanged, onWindowVisibilityChanged, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFocusable, setFocusableInTouchMode, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setIsRootNamespace, setKeepScreenOn, setLayoutParams, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPressed, setSaveEnabled, setScrollBarStyle, setSelected, setSoundEffectsEnabled, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadioButton

public RadioButton(Context context)

RadioButton

public RadioButton(Context context,
                   AttributeSet attrs)

RadioButton

public RadioButton(Context context,
                   AttributeSet attrs,
                   int defStyle)
Method Detail

toggle

public void toggle()
Change the checked state of the view to the inverse of its current state

If the radio button is already checked, this method will not toggle the radio button.

Specified by:
toggle in interface Checkable
Overrides:
toggle in class CompoundButton

Build 1.0_r1(from source)

Please submit a feedback, bug or feature