Code example for CheckBox

Methods: setChecked

0
        periodSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
            @Override 
            public void onItemSelected(AdapterView<?> arg0, View arg1,
                    int arg2, long arg3) {
                if(periodSpinnerInitialized)
                    settingCheckbox.setChecked(true);
                periodSpinnerInitialized = true;
            } 
 
            @Override 
            public void onNothingSelected(AdapterView<?> arg0) {
                // ignore 
            } 
        }); 
 
        // create adapter 
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(
                activity, android.R.layout.simple_spinner_item,
                activity.getResources().getStringArray(R.array.TEA_reminder_random));
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        periodSpinner.setAdapter(adapter);