Code example for Preference.OnPreferenceChangeListener

Methods: onPreferenceChange

0
		preference
				.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
 
		// Trigger the listener immediately with the preference's 
		// current value. 
		sBindPreferenceSummaryToValueListener.onPreferenceChange(
				preference,
				PreferenceManager.getDefaultSharedPreferences(
						preference.getContext()).getString(preference.getKey(),
						"")); 
	} 
 
	/** 
	 * This fragment shows general preferences only. It is used when the 
	 * activity is showing a two-pane settings UI. 
	 */ 
	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	public static class GeneralPreferenceFragment extends PreferenceFragment {
		@Override 
		public void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);