List of usage examples for android.preference PreferenceManager getSharedPreferences
public SharedPreferences getSharedPreferences()
From source file:io.v.android.debug.DebugLogPreferenceFragment.java
@Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final PreferenceManager pm = getPreferenceManager(); pm.setSharedPreferencesName(VAndroidContext.VANADIUM_OPTIONS_SHARED_PREFS); pm.getSharedPreferences().registerOnSharedPreferenceChangeListener(this); createPreferences();/* ww w . j a v a 2s . c o m*/ }
From source file:io.v.baku.toolkit.debug.DebugLogPreferenceFragment.java
@Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final PreferenceManager pm = getPreferenceManager(); pm.setSharedPreferencesName(VAndroidContextTrait.VANADIUM_OPTIONS_SHARED_PREFS); pm.getSharedPreferences().registerOnSharedPreferenceChangeListener(this); createPreferences();/*from ww w . j a va 2 s.c om*/ }
From source file:com.twinone.locker.ui.SettingsFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mProUtils = new ProUtils(getActivity()); mPrefUtils = new PrefUtils(getActivity()); PreferenceManager pm = getPreferenceManager(); pm.setSharedPreferencesName(PrefUtils.PREF_FILE_DEFAULT); pm.setSharedPreferencesMode(Context.MODE_PRIVATE); addPreferencesFromResource(R.xml.prefs); mPrefs = pm.getSharedPreferences(); mEditor = pm.getSharedPreferences().edit(); // mShowNotification = (ProCheckBoxPreference) // findPreference(getString(R.string.pref_key_show_notification)); mShortExitTime = (EditTextPreference) findPreference(getString(R.string.pref_key_delay_time)); mShortExit = (ProCheckBoxPreference) findPreference(getString(R.string.pref_key_delay_status)); mCatNotif = (PreferenceCategory) findPreference(getString(R.string.pref_key_cat_notification)); mTransparentPref = (CheckBoxPreference) findPreference(getString(R.string.pref_key_hide_notification_icon)); mStartWithCall = (ProCheckBoxPreference) findPreference(getString(R.string.pref_key_dial_launch)); mHideIcon = (ProCheckBoxPreference) findPreference(getString(R.string.pref_key_hide_launcher_icon)); mChangeLogPref = (Preference) findPreference(getString(R.string.pref_key_changelog)); mLockTypePref = (Preference) findPreference(getString(R.string.pref_key_lock_type)); mPrefScreen = (PreferenceScreen) findPreference(getString(R.string.pref_key_screen)); mCatPassword = (PreferenceCategory) findPreference(getString(R.string.pref_key_cat_password)); mCatPattern = (PreferenceCategory) findPreference(getString(R.string.pref_key_cat_pattern)); mRecoveryPref = (Preference) findPreference(getString(R.string.pref_key_recovery_code)); mBackground = (ProListPreference) findPreference(getString(R.string.pref_key_background)); mPatternSize = (ProEditTextPreference) findPreference(getString(R.string.pref_key_pattern_size)); initialize();/*from w w w . java2 s. co m*/ }