Code example for PreferenceCategory

Methods: setEnabled

0
	 
	@Override 
	public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
			Preference preference) {
		if(preference.equals((CheckBoxPreference)findPreference("sub_checkbox"))) {
			cat1.setEnabled(mainPreference.getBoolean("sub_checkbox", false));
		}	 
		 
		return super.onPreferenceTreeClick(preferenceScreen, preference);
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java