List of usage examples for android.preference PreferenceScreen getSharedPreferences
public SharedPreferences getSharedPreferences()
From source file:nz.Intelx.DroidNetLogin.DroidNetLoginActivity.java
@Override public void onPreferenceAttached(PreferenceScreen root, int xmlId) { if (root == null) return; //for whatever reason in very rare cases this is null updatePreference(root.getSharedPreferences()); //registering the listeners to the preference screen root.findPreference("login_preference").setOnPreferenceChangeListener(this); root.findPreference("debug_preference").setOnPreferenceChangeListener(this); root.findPreference("proxy_preference").setOnPreferenceChangeListener(this); root.findPreference("manual_login").setOnPreferenceClickListener(this); root.findPreference("manual_logout").setOnPreferenceClickListener(this); root.findPreference("manual_startProxy").setOnPreferenceClickListener(this); root.findPreference("manual_stopProxy").setOnPreferenceClickListener(this); //match summary for Login list preference to selected preference ListPreference login_preference = (ListPreference) root.findPreference("login_preference"); CharSequence Login_Summary = login_preference.getEntry(); login_preference.setSummary(Login_Summary); }