Code example for CheckBoxPreference

Methods: isChecked

0
 
    @Override 
    protected void onPause() { 
        super.onPause(); 
        Settings.setKeySound(mKeySoundPref.isChecked());
        Settings.setVibrate(mVibratePref.isChecked());
        Settings.setPrediction(mPredictionPref.isChecked());
 
        Settings.writeBack(); 
    } 
 
    public boolean onPreferenceChange(Preference preference, Object newValue) {
        return true; 
    } 
 
    private void updateWidgets() { 
        mKeySoundPref.setChecked(Settings.getKeySound());
        mVibratePref.setChecked(Settings.getVibrate());
        mPredictionPref.setChecked(Settings.getPrediction());
    }