Code example for CheckBox

Methods: setChecked, setVisibility

0
        updateSpinners(); 
    } 
 
    private void updateSpinners() { 
        updateDaySpinner(); 
        mYearToggle.setChecked(mHasYear);
        mYearToggle.setVisibility(mYearOptional ? View.VISIBLE : View.GONE);
        mYearPicker.setValue(mYear);
        mYearPicker.setVisibility(mHasYear ? View.VISIBLE : View.GONE);
 
        /* The month display uses 1-12 but our internal state stores it 
         * 0-11 so add one when setting the display. 
         */ 
        mMonthPicker.setValue(mMonth + 1);
    } 
 
    private void updateDaySpinner() { 
        Calendar cal = Calendar.getInstance();
        // if year was not set, use 2000 as it was a leap year 
        cal.set(mHasYear ? mYear : 2000, mMonth, 1);
        int max = cal.getActualMaximum(Calendar.DAY_OF_MONTH);