Code example for CheckBoxPreference

Methods: setChecked

0
     * on one radio alone. We need to do the following: 
     * - handle the case of wifi/bluetooth failures 
     * - mobile does not send failure notification, fail on timeout. 
     */ 
    private void onAirplaneModeChanged() { 
        mCheckBoxPref.setChecked(isAirplaneModeOn(mContext));
    } 
     
    /** 
     * Called when someone clicks on the checkbox preference. 
     */ 
    public boolean onPreferenceChange(Preference preference, Object newValue) {
        if (Boolean.parseBoolean(
                    SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE))) { 
            // In ECM mode, do not update database at this point 
        } else { 
            setAirplaneModeOn((Boolean) newValue);
        } 
        return true; 
    }