Code example for EditTextPreference

Methods: getKeysetEnabled

0
	} 
	 
	@Override 
	public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
	{ 
		if (key.equals(pEtIntervalMinutes.getKey()))
		{ 
			updateIntervalSummary(); 
		} 
		else if (key.equals(pCbIntervalType.getKey()))
		{ 
			updateIntervalTypesEnabled(); 
		} 
		else if (key.equals(pTpDailyTime.getKey()))
		{ 
			updatePTpDailyTime(); 
		} 
		 
	} 
	 
	//// custom preference updates and actions 
	//TODO see what the common actions are and method(pref) them 
	 
	private void setFolderPreferenceClickIntent() 
	{ 
		Intent folderIntent = new Intent(this, FileExplore.class);
		pEtFolder.setIntent(folderIntent);
		pEtFolder.setOnPreferenceClickListener(this);
	} 
	 
	private void updateFolderPreference(Intent receivedIntent)
	{ 
		String selectedFolderPath = receivedIntent.getStringExtra(
				com.vassiliev.androidfilebrowser.FileBrowserActivity.returnDirectoryParameter); 
		 
		 
		pEtFolder.setSummary(selectedFolderPath);
		pEtFolder.setText(selectedFolderPath);
		 
		Toast.makeText(this, "SET AS:\n\n"+pEtFolder.getText(), Toast.LENGTH_SHORT).show();
	} 
 
	private void updateIntervalSummary() 
	{ 
		int interval = Integer.parseInt(pEtIntervalMinutes.getText());
		pEtIntervalMinutes.setSummary(String.format(getString(R.string.pref_summ_periodic_at), interval));
	} 
	 
	private void updateIntervalTypesEnabled() 
	{ 
		if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(pCbIntervalType.getKey(), true))
		{ 
			// set to daily 
			pTpDailyTime.setEnabled(true);
			pEtIntervalMinutes.setEnabled(false);
		} 
		else 
		{ 
			// set to periodic 
			pTpDailyTime.setEnabled(false);