Code example for CheckBoxPreference

Methods: setChecked

     * 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() { 
     * 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; 
Connect your IDE to all the code out there  Get Codota for Java