Code example for Preference

Methods: setOnPreferenceClickListener

0
 
	} 
 
	private void setPreferenceClickListener(Preference pref) {
		if (pref != null) {
			pref.setOnPreferenceClickListener(this);
		} 
	} 
 
	/** 
	 * Refresh the summaries of the prefs. This is done in one single hunk for 
	 * all prefs which is suboptimal from a performance point of view, but is 
	 * less code to write. To optimize, only refresh summaries on the settings 
	 * that actually changed. 
	 */ 
	private void refreshSummaries() { 
		long t1 = System.currentTimeMillis();
		List<Pair<String, Integer>> setSummaryTextPrefs = new LinkedList<Pair<String, Integer>>();
		setSummaryTextPrefs
				.add(new Pair<String, Integer>(PREFS_KEY_GCM_SENDER_ID,
						R.string.config_gcm_sender_id_summary));