@Test public void saveStringSet() { Set<String> expected = new LinkedHashSet<>(); expected.add("Test1"); expected.add("Test2"); expected.add("Test3"); String key = "testKey"; StringSetPreference preference = new StringSetPreference(preferences, key); preference.set(expected); assertThat(preferences.getStringSet(key, null)).isEqualTo(expected); }
@SuppressLint("CommitPrefEdits") @Override public void set(Set<String> value) { getPreferences().edit().putStringSet(getKey(), value).apply(); }
StringSetPreference extends AbsPreference<Set<String>> { @SuppressLint("CommitPrefEdits") @Override public void set(Set<String> value) { getPreferences().edit().putStringSet(getKey(), value).apply(); } }
StringSetPreference extends AbsPreference<Set<String>> { @SuppressLint("CommitPrefEdits") @Override public void set(Set<String> value) { getPreferences().edit().putStringSet(getKey(), value).apply(); } StringSetPreference(SharedPreferences preferences, String key);  StringSetPreference(SharedPreferences preferences, String key, Set<String> defaultValue); }
StringSetPreference extends AbsPreference<Set<String>> { @SuppressLint("CommitPrefEdits") @Override public void set(Set<String> value) { getPreferences().edit().putStringSet(getKey(), value).apply(); } StringSetPreference(SharedPreferences preferences, String key);  StringSetPreference(SharedPreferences preferences, String key, Set<String> defaultValue); @Override Set<String> get(); @SuppressLint("CommitPrefEdits") @Override void set(Set<String> value); }
StringSetPreference extends AbsPreference<Set<String>> { @SuppressLint("CommitPrefEdits") @Override public void set(Set<String> value) { getPreferences().edit().putStringSet(getKey(), value).apply(); } StringSetPreference(SharedPreferences preferences, String key);  StringSetPreference(SharedPreferences preferences, String key, Set<String> defaultValue); @Override Set<String> get(); @SuppressLint("CommitPrefEdits") @Override void set(Set<String> value);  }