@Test public void saveString() { String expected = "Test"; String key = "testKey"; StringPreference preference = new StringPreference(preferences, key); preference.set(expected); assertThat(preferences.getString(key, null)).isEqualTo(expected); }
@SuppressLint("CommitPrefEdits") @Override public void set(String value) { Editor editor = getPreferences().edit().putString(getKey(), value); PREF_SAVER.save(editor); }
StringPreference extends AbsPreference<String> { @SuppressLint("CommitPrefEdits") @Override public void set(String value) { Editor editor = getPreferences().edit().putString(getKey(), value); PREF_SAVER.save(editor); } }
StringPreference extends AbsPreference<String> { @SuppressLint("CommitPrefEdits") @Override public void set(String value) { Editor editor = getPreferences().edit().putString(getKey(), value); PREF_SAVER.save(editor); } StringPreference(SharedPreferences preferences, String key);  StringPreference(SharedPreferences preferences, String key, String defaultValue); }
StringPreference extends AbsPreference<String> { @SuppressLint("CommitPrefEdits") @Override public void set(String value) { Editor editor = getPreferences().edit().putString(getKey(), value); PREF_SAVER.save(editor); } StringPreference(SharedPreferences preferences, String key);  StringPreference(SharedPreferences preferences, String key, String defaultValue); @Override String get(); @SuppressLint("CommitPrefEdits") @Override void set(String value); }
StringPreference extends AbsPreference<String> { @SuppressLint("CommitPrefEdits") @Override public void set(String value) { Editor editor = getPreferences().edit().putString(getKey(), value); PREF_SAVER.save(editor); } StringPreference(SharedPreferences preferences, String key);  StringPreference(SharedPreferences preferences, String key, String defaultValue); @Override String get(); @SuppressLint("CommitPrefEdits") @Override void set(String value);  }