Code example for PreferenceCategory

Methods: setEnabled

0
		} 
		else 
		{ 
			//Log.d("ServerPreference", "is not checked"); 
			 
			connectionSettings.setEnabled(true);
			ListPreference list     = (ListPreference)findPreference("lpConnectionType");
			SharedPreferences preferences = getSharedPreferences("preferences.xml", Activity.MODE_WORLD_READABLE);
			EditTextPreference ipPreference = (EditTextPreference) findPreference("etIP");
			if(list.getValue().equals(preferences.getString("lpConnectionType", list.getEntryValues()[0].toString())))
			{ 
				 
				 
				ipPreference.setEnabled(false);
			} 
			else 
			{ 
				ipPreference.setEnabled(true);
			} 
			 
Connect your IDE to all the code out there  Get Codota for Java