Code example for EditTextPreference

Methods: setDependencysetKey, setText

	protected final EditTextPreference initTextPreference(String baseName, String defValue, String dependency) {
		// Update the loaded Preference with the actual preference key to load/store with 
		EditTextPreference pref = (EditTextPreference) findPreference(baseName);
		pref.setKey(baseName + "_" + key);
		pref.setDependency(dependency == null? null: dependency + "_" + key);
		// Update the Preference by loading the current stored value into the EditText, if it exists 
		pref.setText(sharedPrefs.getString(baseName + "_" + key, defValue));
		return pref;
	 * Updates a preference that simply shows a check box. No default value will be shown. 
	 * @param baseName The base name of the stored preference, e.g. item_name, which will then actually be stored under 
	 *            item_name_[key] 
	 * @return The concrete {@link CheckBoxPreference} that is bound to this preference 
	protected final CheckBoxPreference initBooleanPreference(String baseName) {
		return initBooleanPreference(baseName, false);